2019-01-07 21:10:31 +00:00
|
|
|
use super::{
|
2019-01-11 20:14:37 +00:00
|
|
|
consts::Consts,
|
2019-04-29 20:37:19 +00:00
|
|
|
gfx_backend,
|
2019-08-19 17:23:47 +00:00
|
|
|
instances::Instances,
|
2019-01-07 21:10:31 +00:00
|
|
|
mesh::Mesh,
|
2019-05-04 14:28:21 +00:00
|
|
|
model::{DynamicModel, Model},
|
2020-07-25 15:56:50 +00:00
|
|
|
pipelines::{
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
figure, fluid, lod_terrain, particle, postprocess, shadow, skybox, sprite, terrain, ui,
|
|
|
|
GlobalModel, Globals,
|
2020-07-25 15:56:50 +00:00
|
|
|
},
|
2019-01-30 12:11:34 +00:00
|
|
|
texture::Texture,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
AaMode, CloudMode, FilterMethod, FluidMode, LightingMode, Pipeline, RenderError, RenderMode,
|
|
|
|
ShadowMapMode, ShadowMode, WrapMode,
|
2019-01-07 21:10:31 +00:00
|
|
|
};
|
2020-08-26 06:11:56 +00:00
|
|
|
use common::{
|
|
|
|
assets::{self, watch::ReloadIndicator, Asset},
|
|
|
|
span,
|
|
|
|
};
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
use core::convert::TryFrom;
|
2019-04-29 20:37:19 +00:00
|
|
|
use gfx::{
|
|
|
|
self,
|
2019-05-06 08:22:47 +00:00
|
|
|
handle::Sampler,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
state::Comparison,
|
2019-05-06 08:22:47 +00:00
|
|
|
traits::{Device, Factory, FactoryExt},
|
2019-04-29 20:37:19 +00:00
|
|
|
};
|
2019-05-12 09:10:13 +00:00
|
|
|
use glsl_include::Context as IncludeContext;
|
2020-08-28 01:02:17 +00:00
|
|
|
use image::DynamicImage;
|
|
|
|
use std::{
|
|
|
|
fs::File,
|
|
|
|
io::{BufReader, Read},
|
|
|
|
};
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
use tracing::{error, warn};
|
2019-04-29 20:37:19 +00:00
|
|
|
use vek::*;
|
2019-01-07 21:10:31 +00:00
|
|
|
|
2019-05-06 16:27:21 +00:00
|
|
|
/// Represents the format of the pre-processed color target.
|
2019-08-04 19:54:08 +00:00
|
|
|
pub type TgtColorFmt = gfx::format::Srgba8;
|
2020-04-04 19:36:55 +00:00
|
|
|
/// Represents the format of the pre-processed depth and stencil target.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
pub type TgtDepthStencilFmt = gfx::format::Depth;
|
2019-05-06 16:27:21 +00:00
|
|
|
|
2019-01-11 23:18:34 +00:00
|
|
|
/// Represents the format of the window's color target.
|
2019-08-12 01:53:48 +00:00
|
|
|
pub type WinColorFmt = gfx::format::Srgba8;
|
2019-01-11 23:18:34 +00:00
|
|
|
/// Represents the format of the window's depth target.
|
2019-08-03 09:55:45 +00:00
|
|
|
pub type WinDepthFmt = gfx::format::Depth;
|
2019-01-07 21:10:31 +00:00
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Represents the format of the pre-processed shadow depth target.
|
|
|
|
pub type ShadowDepthStencilFmt = gfx::format::Depth;
|
|
|
|
|
2019-05-06 16:27:21 +00:00
|
|
|
/// A handle to a pre-processed color target.
|
2019-01-11 17:30:13 +00:00
|
|
|
pub type TgtColorView = gfx::handle::RenderTargetView<gfx_backend::Resources, TgtColorFmt>;
|
2019-05-06 16:27:21 +00:00
|
|
|
/// A handle to a pre-processed depth target.
|
2020-04-04 19:36:55 +00:00
|
|
|
pub type TgtDepthStencilView =
|
|
|
|
gfx::handle::DepthStencilView<gfx_backend::Resources, TgtDepthStencilFmt>;
|
2019-01-07 21:10:31 +00:00
|
|
|
|
2019-05-06 16:27:21 +00:00
|
|
|
/// A handle to a window color target.
|
|
|
|
pub type WinColorView = gfx::handle::RenderTargetView<gfx_backend::Resources, WinColorFmt>;
|
|
|
|
/// A handle to a window depth target.
|
|
|
|
pub type WinDepthView = gfx::handle::DepthStencilView<gfx_backend::Resources, WinDepthFmt>;
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Represents the format of LOD shadows.
|
|
|
|
pub type LodTextureFmt = (gfx::format::R8_G8_B8_A8, gfx::format::Unorm);
|
|
|
|
|
|
|
|
/// Represents the format of LOD altitudes.
|
|
|
|
pub type LodAltFmt = (gfx::format::R16_G16, gfx::format::Unorm);
|
|
|
|
|
|
|
|
/// Represents the format of LOD map colors.
|
|
|
|
pub type LodColorFmt = (gfx::format::R8_G8_B8_A8, gfx::format::Srgb);
|
|
|
|
|
|
|
|
/// Represents the format of greedy meshed color-light textures.
|
|
|
|
pub type ColLightFmt = (gfx::format::R8_G8_B8_A8, gfx::format::Srgb);
|
|
|
|
|
|
|
|
/// A handle to a shadow depth target.
|
|
|
|
pub type ShadowDepthStencilView =
|
|
|
|
gfx::handle::DepthStencilView<gfx_backend::Resources, ShadowDepthStencilFmt>;
|
|
|
|
/// A handle to a shadow depth target as a resource.
|
|
|
|
pub type ShadowResourceView = gfx::handle::ShaderResourceView<
|
|
|
|
gfx_backend::Resources,
|
|
|
|
<ShadowDepthStencilFmt as gfx::format::Formatted>::View,
|
|
|
|
>;
|
|
|
|
|
2019-05-06 08:22:47 +00:00
|
|
|
/// A handle to a render color target as a resource.
|
|
|
|
pub type TgtColorRes = gfx::handle::ShaderResourceView<
|
|
|
|
gfx_backend::Resources,
|
|
|
|
<TgtColorFmt as gfx::format::Formatted>::View,
|
|
|
|
>;
|
|
|
|
|
2020-10-21 21:05:25 +00:00
|
|
|
/// A handle to a render depth target as a resource.
|
|
|
|
pub type TgtDepthRes = gfx::handle::ShaderResourceView<
|
|
|
|
gfx_backend::Resources,
|
|
|
|
<TgtDepthStencilFmt as gfx::format::Formatted>::View,
|
|
|
|
>;
|
|
|
|
|
2020-08-25 12:21:25 +00:00
|
|
|
/// A handle to a greedy meshed color-light texture as a resource.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
pub type ColLightRes = gfx::handle::ShaderResourceView<
|
|
|
|
gfx_backend::Resources,
|
|
|
|
<ColLightFmt as gfx::format::Formatted>::View,
|
|
|
|
>;
|
|
|
|
/// A type representing data that can be converted to an immutable texture map
|
|
|
|
/// of ColLight data (used for texture atlases created during greedy meshing).
|
|
|
|
pub type ColLightInfo = (
|
|
|
|
Vec<<<ColLightFmt as gfx::format::Formatted>::Surface as gfx::format::SurfaceTyped>::DataType>,
|
|
|
|
Vec2<u16>,
|
|
|
|
);
|
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
/// Load from a GLSL file.
|
|
|
|
pub struct Glsl;
|
|
|
|
|
|
|
|
impl Asset for Glsl {
|
|
|
|
type Output = String;
|
|
|
|
|
|
|
|
const ENDINGS: &'static [&'static str] = &["glsl"];
|
|
|
|
|
2020-09-17 23:02:14 +00:00
|
|
|
fn parse(mut buf_reader: BufReader<File>, _specifier: &str) -> Result<String, assets::Error> {
|
2020-08-28 01:02:17 +00:00
|
|
|
let mut string = String::new();
|
|
|
|
buf_reader.read_to_string(&mut string)?;
|
|
|
|
Ok(string)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// A type that holds shadow map data. Since shadow mapping may not be
|
|
|
|
/// supported on all platforms, we try to keep it separate.
|
|
|
|
pub struct ShadowMapRenderer {
|
|
|
|
// directed_encoder: gfx::Encoder<gfx_backend::Resources, gfx_backend::CommandBuffer>,
|
|
|
|
// point_encoder: gfx::Encoder<gfx_backend::Resources, gfx_backend::CommandBuffer>,
|
|
|
|
directed_depth_stencil_view: ShadowDepthStencilView,
|
|
|
|
directed_res: ShadowResourceView,
|
|
|
|
directed_sampler: Sampler<gfx_backend::Resources>,
|
|
|
|
|
|
|
|
point_depth_stencil_view: ShadowDepthStencilView,
|
|
|
|
point_res: ShadowResourceView,
|
|
|
|
point_sampler: Sampler<gfx_backend::Resources>,
|
|
|
|
|
|
|
|
point_pipeline: GfxPipeline<shadow::pipe::Init<'static>>,
|
|
|
|
terrain_directed_pipeline: GfxPipeline<shadow::pipe::Init<'static>>,
|
|
|
|
figure_directed_pipeline: GfxPipeline<shadow::figure_pipe::Init<'static>>,
|
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// A type that encapsulates rendering state. `Renderer` is central to Voxygen's
|
|
|
|
/// rendering subsystem and contains any state necessary to interact with the
|
|
|
|
/// GPU, along with pipeline state objects (PSOs) needed to renderer different
|
|
|
|
/// kinds of models to the screen.
|
2019-01-07 21:10:31 +00:00
|
|
|
pub struct Renderer {
|
2019-01-11 17:30:13 +00:00
|
|
|
device: gfx_backend::Device,
|
|
|
|
encoder: gfx::Encoder<gfx_backend::Resources, gfx_backend::CommandBuffer>,
|
|
|
|
factory: gfx_backend::Factory,
|
|
|
|
|
2019-05-06 16:27:21 +00:00
|
|
|
win_color_view: WinColorView,
|
|
|
|
win_depth_view: WinDepthView,
|
2019-05-06 08:22:47 +00:00
|
|
|
|
2019-01-11 17:30:13 +00:00
|
|
|
tgt_color_view: TgtColorView,
|
2020-04-04 19:36:55 +00:00
|
|
|
tgt_depth_stencil_view: TgtDepthStencilView,
|
2019-01-11 20:14:37 +00:00
|
|
|
|
2019-05-06 08:22:47 +00:00
|
|
|
tgt_color_res: TgtColorRes,
|
2020-10-21 21:05:25 +00:00
|
|
|
tgt_depth_res: TgtDepthRes,
|
2019-05-06 08:22:47 +00:00
|
|
|
|
|
|
|
sampler: Sampler<gfx_backend::Resources>,
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
shadow_map: Option<ShadowMapRenderer>,
|
|
|
|
|
2019-01-11 20:14:37 +00:00
|
|
|
skybox_pipeline: GfxPipeline<skybox::pipe::Init<'static>>,
|
2019-01-13 20:53:55 +00:00
|
|
|
figure_pipeline: GfxPipeline<figure::pipe::Init<'static>>,
|
2019-01-14 23:13:58 +00:00
|
|
|
terrain_pipeline: GfxPipeline<terrain::pipe::Init<'static>>,
|
2019-08-14 21:28:37 +00:00
|
|
|
fluid_pipeline: GfxPipeline<fluid::pipe::Init<'static>>,
|
2019-08-19 17:01:23 +00:00
|
|
|
sprite_pipeline: GfxPipeline<sprite::pipe::Init<'static>>,
|
2020-06-30 14:29:35 +00:00
|
|
|
particle_pipeline: GfxPipeline<particle::pipe::Init<'static>>,
|
2019-01-30 12:11:34 +00:00
|
|
|
ui_pipeline: GfxPipeline<ui::pipe::Init<'static>>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod_terrain_pipeline: GfxPipeline<lod_terrain::pipe::Init<'static>>,
|
2019-05-06 08:22:47 +00:00
|
|
|
postprocess_pipeline: GfxPipeline<postprocess::pipe::Init<'static>>,
|
2020-04-04 19:36:55 +00:00
|
|
|
player_shadow_pipeline: GfxPipeline<figure::pipe::Init<'static>>,
|
2019-08-03 05:42:33 +00:00
|
|
|
|
|
|
|
shader_reload_indicator: ReloadIndicator,
|
2019-09-26 07:28:40 +00:00
|
|
|
|
2019-11-17 22:41:00 +00:00
|
|
|
noise_tex: Texture<(gfx::format::R8, gfx::format::Unorm)>,
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
mode: RenderMode,
|
2019-01-07 21:10:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Renderer {
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Create a new `Renderer` from a variety of backend-specific components
|
|
|
|
/// and the window targets.
|
2019-01-07 21:10:31 +00:00
|
|
|
pub fn new(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
mut device: gfx_backend::Device,
|
2019-01-11 17:30:13 +00:00
|
|
|
mut factory: gfx_backend::Factory,
|
2019-05-06 16:27:21 +00:00
|
|
|
win_color_view: WinColorView,
|
|
|
|
win_depth_view: WinDepthView,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
mode: RenderMode,
|
2019-01-11 23:18:34 +00:00
|
|
|
) -> Result<Self, RenderError> {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
// Enable seamless cubemaps globally, where available--they are essentially a
|
|
|
|
// strict improvement on regular cube maps.
|
|
|
|
//
|
|
|
|
// Note that since we only have to enable this once globally, there is no point
|
|
|
|
// in doing this on rerender.
|
|
|
|
Self::enable_seamless_cube_maps(&mut device);
|
|
|
|
|
|
|
|
let dims = win_color_view.get_dimensions();
|
|
|
|
|
2019-08-03 05:42:33 +00:00
|
|
|
let mut shader_reload_indicator = ReloadIndicator::new();
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let shadow_views = Self::create_shadow_views(
|
|
|
|
&mut factory,
|
|
|
|
(dims.0, dims.1),
|
|
|
|
&ShadowMapMode::try_from(mode.shadow).unwrap_or_default(),
|
|
|
|
)
|
|
|
|
.map_err(|err| {
|
|
|
|
warn!("Could not create shadow map views: {:?}", err);
|
|
|
|
})
|
|
|
|
.ok();
|
2019-08-03 05:42:33 +00:00
|
|
|
|
2019-08-17 17:07:25 +00:00
|
|
|
let (
|
|
|
|
skybox_pipeline,
|
|
|
|
figure_pipeline,
|
|
|
|
terrain_pipeline,
|
|
|
|
fluid_pipeline,
|
2019-08-19 17:01:23 +00:00
|
|
|
sprite_pipeline,
|
2020-06-30 14:29:35 +00:00
|
|
|
particle_pipeline,
|
2019-08-17 17:07:25 +00:00
|
|
|
ui_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod_terrain_pipeline,
|
2019-08-17 17:07:25 +00:00
|
|
|
postprocess_pipeline,
|
2020-04-04 19:36:55 +00:00
|
|
|
player_shadow_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
point_shadow_pipeline,
|
|
|
|
terrain_directed_shadow_pipeline,
|
|
|
|
figure_directed_shadow_pipeline,
|
2020-01-19 03:58:25 +00:00
|
|
|
) = create_pipelines(
|
|
|
|
&mut factory,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&mode,
|
|
|
|
shadow_views.is_some(),
|
2020-01-19 03:58:25 +00:00
|
|
|
&mut shader_reload_indicator,
|
|
|
|
)?;
|
2019-05-06 08:22:47 +00:00
|
|
|
|
2020-10-21 21:05:25 +00:00
|
|
|
let (tgt_color_view, tgt_depth_stencil_view, tgt_color_res, tgt_depth_res) =
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
Self::create_rt_views(&mut factory, (dims.0, dims.1), &mode)?;
|
|
|
|
|
|
|
|
let shadow_map = if let (
|
|
|
|
Some(point_pipeline),
|
|
|
|
Some(terrain_directed_pipeline),
|
|
|
|
Some(figure_directed_pipeline),
|
|
|
|
Some(shadow_views),
|
|
|
|
) = (
|
|
|
|
point_shadow_pipeline,
|
|
|
|
terrain_directed_shadow_pipeline,
|
|
|
|
figure_directed_shadow_pipeline,
|
|
|
|
shadow_views,
|
|
|
|
) {
|
|
|
|
let (
|
|
|
|
point_depth_stencil_view,
|
|
|
|
point_res,
|
|
|
|
point_sampler,
|
|
|
|
directed_depth_stencil_view,
|
|
|
|
directed_res,
|
|
|
|
directed_sampler,
|
|
|
|
) = shadow_views;
|
|
|
|
Some(ShadowMapRenderer {
|
|
|
|
// point_encoder: factory.create_command_buffer().into(),
|
|
|
|
// directed_encoder: factory.create_command_buffer().into(),
|
|
|
|
point_depth_stencil_view,
|
|
|
|
point_res,
|
|
|
|
point_sampler,
|
|
|
|
|
|
|
|
directed_depth_stencil_view,
|
|
|
|
directed_res,
|
|
|
|
directed_sampler,
|
|
|
|
|
|
|
|
point_pipeline,
|
|
|
|
terrain_directed_pipeline,
|
|
|
|
figure_directed_pipeline,
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
None
|
|
|
|
};
|
2019-05-06 08:22:47 +00:00
|
|
|
|
|
|
|
let sampler = factory.create_sampler_linear();
|
|
|
|
|
2019-11-17 22:41:00 +00:00
|
|
|
let noise_tex = Texture::new(
|
|
|
|
&mut factory,
|
2020-08-28 01:02:17 +00:00
|
|
|
&DynamicImage::load_expect("voxygen.texture.noise"),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
Some(gfx::texture::FilterMethod::Bilinear),
|
2019-11-17 22:41:00 +00:00
|
|
|
Some(gfx::texture::WrapMode::Tile),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
None,
|
2019-11-17 22:41:00 +00:00
|
|
|
)?;
|
|
|
|
|
2019-01-07 21:10:31 +00:00
|
|
|
Ok(Self {
|
2019-01-11 17:30:13 +00:00
|
|
|
device,
|
|
|
|
encoder: factory.create_command_buffer().into(),
|
2019-01-07 21:10:31 +00:00
|
|
|
factory,
|
2019-01-11 20:14:37 +00:00
|
|
|
|
2019-05-06 08:22:47 +00:00
|
|
|
win_color_view,
|
|
|
|
win_depth_view,
|
|
|
|
|
2019-01-11 17:30:13 +00:00
|
|
|
tgt_color_view,
|
2020-04-04 19:36:55 +00:00
|
|
|
tgt_depth_stencil_view,
|
2019-01-11 20:14:37 +00:00
|
|
|
|
2019-05-06 08:22:47 +00:00
|
|
|
tgt_color_res,
|
2020-10-21 21:05:25 +00:00
|
|
|
tgt_depth_res,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
|
2019-05-06 08:22:47 +00:00
|
|
|
sampler,
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
shadow_map,
|
|
|
|
|
2019-01-11 20:14:37 +00:00
|
|
|
skybox_pipeline,
|
2019-01-13 20:53:55 +00:00
|
|
|
figure_pipeline,
|
2019-01-14 23:13:58 +00:00
|
|
|
terrain_pipeline,
|
2019-08-14 21:28:37 +00:00
|
|
|
fluid_pipeline,
|
2019-08-19 17:01:23 +00:00
|
|
|
sprite_pipeline,
|
2020-06-30 14:29:35 +00:00
|
|
|
particle_pipeline,
|
2019-01-30 12:11:34 +00:00
|
|
|
ui_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod_terrain_pipeline,
|
2019-05-06 08:22:47 +00:00
|
|
|
postprocess_pipeline,
|
2020-04-04 19:36:55 +00:00
|
|
|
player_shadow_pipeline,
|
2019-08-03 05:42:33 +00:00
|
|
|
|
|
|
|
shader_reload_indicator,
|
2019-09-26 07:28:40 +00:00
|
|
|
|
2019-11-17 22:41:00 +00:00
|
|
|
noise_tex,
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
mode,
|
2019-01-07 21:10:31 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Get references to the internal render target views that get rendered to
|
|
|
|
/// before post-processing.
|
2019-05-06 16:27:21 +00:00
|
|
|
#[allow(dead_code)]
|
2020-04-04 19:36:55 +00:00
|
|
|
pub fn tgt_views(&self) -> (&TgtColorView, &TgtDepthStencilView) {
|
|
|
|
(&self.tgt_color_view, &self.tgt_depth_stencil_view)
|
2019-05-06 16:27:21 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Get references to the internal render target views that get displayed
|
|
|
|
/// directly by the window.
|
2019-05-06 16:27:21 +00:00
|
|
|
#[allow(dead_code)]
|
|
|
|
pub fn win_views(&self) -> (&WinColorView, &WinDepthView) {
|
2019-05-06 08:22:47 +00:00
|
|
|
(&self.win_color_view, &self.win_depth_view)
|
2019-01-23 22:39:31 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Get mutable references to the internal render target views that get
|
|
|
|
/// rendered to before post-processing.
|
2019-05-06 16:27:21 +00:00
|
|
|
#[allow(dead_code)]
|
2020-04-04 19:36:55 +00:00
|
|
|
pub fn tgt_views_mut(&mut self) -> (&mut TgtColorView, &mut TgtDepthStencilView) {
|
|
|
|
(&mut self.tgt_color_view, &mut self.tgt_depth_stencil_view)
|
2019-05-06 16:27:21 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Get mutable references to the internal render target views that get
|
|
|
|
/// displayed directly by the window.
|
2019-05-06 16:27:21 +00:00
|
|
|
#[allow(dead_code)]
|
|
|
|
pub fn win_views_mut(&mut self) -> (&mut WinColorView, &mut WinDepthView) {
|
2019-05-06 08:22:47 +00:00
|
|
|
(&mut self.win_color_view, &mut self.win_depth_view)
|
|
|
|
}
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Change the render mode.
|
|
|
|
pub fn set_render_mode(&mut self, mode: RenderMode) -> Result<(), RenderError> {
|
|
|
|
self.mode = mode;
|
2019-09-26 07:28:40 +00:00
|
|
|
|
|
|
|
// Recreate render target
|
|
|
|
self.on_resize()?;
|
|
|
|
|
|
|
|
// Recreate pipelines with the new AA mode
|
|
|
|
self.recreate_pipelines();
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Get the render mode.
|
|
|
|
pub fn render_mode(&self) -> &RenderMode { &self.mode }
|
2020-01-19 03:58:25 +00:00
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
/// Resize internal render targets to match window render target dimensions.
|
2019-05-06 08:22:47 +00:00
|
|
|
pub fn on_resize(&mut self) -> Result<(), RenderError> {
|
|
|
|
let dims = self.win_color_view.get_dimensions();
|
2019-05-06 12:03:15 +00:00
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
// Avoid panics when creating texture with w,h of 0,0.
|
2019-05-17 05:13:14 +00:00
|
|
|
if dims.0 != 0 && dims.1 != 0 {
|
2020-10-21 21:05:25 +00:00
|
|
|
let (tgt_color_view, tgt_depth_stencil_view, tgt_color_res, tgt_depth_res) =
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
Self::create_rt_views(&mut self.factory, (dims.0, dims.1), &self.mode)?;
|
2019-05-17 05:13:14 +00:00
|
|
|
self.tgt_color_res = tgt_color_res;
|
2020-10-21 21:05:25 +00:00
|
|
|
self.tgt_depth_res = tgt_depth_res;
|
2019-05-17 05:13:14 +00:00
|
|
|
self.tgt_color_view = tgt_color_view;
|
2020-04-04 19:36:55 +00:00
|
|
|
self.tgt_depth_stencil_view = tgt_depth_stencil_view;
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
if let (Some(shadow_map), ShadowMode::Map(mode)) =
|
|
|
|
(self.shadow_map.as_mut(), self.mode.shadow)
|
|
|
|
{
|
|
|
|
match Self::create_shadow_views(&mut self.factory, (dims.0, dims.1), &mode) {
|
|
|
|
Ok((
|
|
|
|
point_depth_stencil_view,
|
|
|
|
point_res,
|
|
|
|
point_sampler,
|
|
|
|
directed_depth_stencil_view,
|
|
|
|
directed_res,
|
|
|
|
directed_sampler,
|
|
|
|
)) => {
|
|
|
|
shadow_map.point_depth_stencil_view = point_depth_stencil_view;
|
|
|
|
shadow_map.point_res = point_res;
|
|
|
|
shadow_map.point_sampler = point_sampler;
|
|
|
|
|
|
|
|
shadow_map.directed_depth_stencil_view = directed_depth_stencil_view;
|
|
|
|
shadow_map.directed_res = directed_res;
|
|
|
|
shadow_map.directed_sampler = directed_sampler;
|
|
|
|
},
|
|
|
|
Err(err) => {
|
|
|
|
warn!("Could not create shadow map views: {:?}", err);
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-05-17 05:13:14 +00:00
|
|
|
}
|
2019-05-06 08:22:47 +00:00
|
|
|
|
|
|
|
Ok(())
|
2019-01-23 22:39:31 +00:00
|
|
|
}
|
|
|
|
|
2019-05-06 12:03:15 +00:00
|
|
|
fn create_rt_views(
|
|
|
|
factory: &mut gfx_device_gl::Factory,
|
|
|
|
size: (u16, u16),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
mode: &RenderMode,
|
2020-10-21 21:05:25 +00:00
|
|
|
) -> Result<(TgtColorView, TgtDepthStencilView, TgtColorRes, TgtDepthRes), RenderError> {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let kind = match mode.aa {
|
2019-09-26 07:28:40 +00:00
|
|
|
AaMode::None | AaMode::Fxaa => {
|
|
|
|
gfx::texture::Kind::D2(size.0, size.1, gfx::texture::AaMode::Single)
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-09-26 07:28:40 +00:00
|
|
|
// TODO: Ensure sampling in the shader is exactly between the 4 texels
|
|
|
|
AaMode::SsaaX4 => {
|
|
|
|
gfx::texture::Kind::D2(size.0 * 2, size.1 * 2, gfx::texture::AaMode::Single)
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-09-26 07:28:40 +00:00
|
|
|
AaMode::MsaaX4 => {
|
|
|
|
gfx::texture::Kind::D2(size.0, size.1, gfx::texture::AaMode::Multi(4))
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-09-26 07:28:40 +00:00
|
|
|
AaMode::MsaaX8 => {
|
|
|
|
gfx::texture::Kind::D2(size.0, size.1, gfx::texture::AaMode::Multi(8))
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-09-26 07:28:40 +00:00
|
|
|
AaMode::MsaaX16 => {
|
|
|
|
gfx::texture::Kind::D2(size.0, size.1, gfx::texture::AaMode::Multi(16))
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2019-09-26 07:28:40 +00:00
|
|
|
};
|
2019-09-26 03:19:45 +00:00
|
|
|
let levels = 1;
|
|
|
|
|
|
|
|
let color_cty = <<TgtColorFmt as gfx::format::Formatted>::Channel as gfx::format::ChannelTyped
|
|
|
|
>::get_channel_type();
|
|
|
|
let tgt_color_tex = factory.create_texture(
|
|
|
|
kind,
|
|
|
|
levels,
|
|
|
|
gfx::memory::Bind::SHADER_RESOURCE | gfx::memory::Bind::RENDER_TARGET,
|
|
|
|
gfx::memory::Usage::Data,
|
|
|
|
Some(color_cty),
|
|
|
|
)?;
|
|
|
|
let tgt_color_res = factory.view_texture_as_shader_resource::<TgtColorFmt>(
|
|
|
|
&tgt_color_tex,
|
|
|
|
(0, levels - 1),
|
|
|
|
gfx::format::Swizzle::new(),
|
|
|
|
)?;
|
|
|
|
let tgt_color_view = factory.view_texture_as_render_target(&tgt_color_tex, 0, None)?;
|
|
|
|
|
2020-04-04 19:36:55 +00:00
|
|
|
let depth_stencil_cty = <<TgtDepthStencilFmt as gfx::format::Formatted>::Channel as gfx::format::ChannelTyped>::get_channel_type();
|
|
|
|
let tgt_depth_stencil_tex = factory.create_texture(
|
2019-09-26 03:19:45 +00:00
|
|
|
kind,
|
|
|
|
levels,
|
2020-10-21 21:05:25 +00:00
|
|
|
gfx::memory::Bind::SHADER_RESOURCE | gfx::memory::Bind::DEPTH_STENCIL,
|
2019-09-26 03:19:45 +00:00
|
|
|
gfx::memory::Usage::Data,
|
2020-04-04 19:36:55 +00:00
|
|
|
Some(depth_stencil_cty),
|
2019-09-26 03:19:45 +00:00
|
|
|
)?;
|
2020-10-21 21:05:25 +00:00
|
|
|
let tgt_depth_res = factory.view_texture_as_shader_resource::<TgtDepthStencilFmt>(
|
|
|
|
&tgt_depth_stencil_tex,
|
|
|
|
(0, levels - 1),
|
|
|
|
gfx::format::Swizzle::new(),
|
|
|
|
)?;
|
2020-04-04 19:36:55 +00:00
|
|
|
let tgt_depth_stencil_view =
|
|
|
|
factory.view_texture_as_depth_stencil_trivial(&tgt_depth_stencil_tex)?;
|
2019-09-26 03:19:45 +00:00
|
|
|
|
2020-10-21 21:05:25 +00:00
|
|
|
Ok((
|
|
|
|
tgt_color_view,
|
|
|
|
tgt_depth_stencil_view,
|
|
|
|
tgt_color_res,
|
|
|
|
tgt_depth_res,
|
|
|
|
))
|
2019-05-06 12:03:15 +00:00
|
|
|
}
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Create textures and views for shadow maps.
|
|
|
|
// This is a one-use type and the two halves are not guaranteed to remain identical, so we
|
|
|
|
// disable the type complexity lint.
|
|
|
|
#[allow(clippy::type_complexity)]
|
|
|
|
fn create_shadow_views(
|
|
|
|
factory: &mut gfx_device_gl::Factory,
|
|
|
|
size: (u16, u16),
|
|
|
|
mode: &ShadowMapMode,
|
|
|
|
) -> Result<
|
|
|
|
(
|
|
|
|
ShadowDepthStencilView,
|
|
|
|
ShadowResourceView,
|
|
|
|
Sampler<gfx_backend::Resources>,
|
|
|
|
ShadowDepthStencilView,
|
|
|
|
ShadowResourceView,
|
|
|
|
Sampler<gfx_backend::Resources>,
|
|
|
|
),
|
|
|
|
RenderError,
|
|
|
|
> {
|
|
|
|
// (Attempt to) apply resolution factor to shadow map resolution.
|
|
|
|
let resolution_factor = mode.resolution.clamped(0.25, 4.0);
|
|
|
|
|
|
|
|
let max_texture_size = Self::max_texture_size_raw(factory);
|
|
|
|
// Limit to max texture size, rather than erroring.
|
|
|
|
let size = Vec2::new(size.0, size.1).map(|e| {
|
|
|
|
let size = f32::from(e) * resolution_factor;
|
|
|
|
// NOTE: We know 0 <= e since we clamped the resolution factor to be between
|
|
|
|
// 0.25 and 4.0.
|
|
|
|
if size <= f32::from(max_texture_size) {
|
|
|
|
size as u16
|
|
|
|
} else {
|
|
|
|
max_texture_size
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
let levels = 1;
|
|
|
|
// Limit to max texture size rather than erroring.
|
|
|
|
let two_size = size.map(|e| {
|
|
|
|
u16::checked_next_power_of_two(e)
|
|
|
|
.filter(|&e| e <= max_texture_size)
|
|
|
|
.unwrap_or(max_texture_size)
|
|
|
|
});
|
|
|
|
let min_size = size.reduce_min();
|
|
|
|
let max_size = size.reduce_max();
|
|
|
|
let _min_two_size = two_size.reduce_min();
|
|
|
|
let _max_two_size = two_size.reduce_max();
|
|
|
|
// For rotated shadow maps, the maximum size of a pixel along any axis is the
|
|
|
|
// size of a diagonal along that axis.
|
|
|
|
let diag_size = size.map(f64::from).magnitude();
|
|
|
|
let diag_cross_size = f64::from(min_size) / f64::from(max_size) * diag_size;
|
|
|
|
let (diag_size, _diag_cross_size) =
|
|
|
|
if 0.0 < diag_size && diag_size <= f64::from(max_texture_size) {
|
|
|
|
// NOTE: diag_cross_size must be non-negative, since it is the ratio of a
|
|
|
|
// non-negative and a positive number (if max_size were zero,
|
|
|
|
// diag_size would be 0 too). And it must be <= diag_size,
|
|
|
|
// since min_size <= max_size. Therefore, if diag_size fits in a
|
|
|
|
// u16, so does diag_cross_size.
|
|
|
|
(diag_size as u16, diag_cross_size as u16)
|
|
|
|
} else {
|
|
|
|
// Limit to max texture resolution rather than error.
|
|
|
|
(max_texture_size as u16, max_texture_size as u16)
|
|
|
|
};
|
|
|
|
let diag_two_size = u16::checked_next_power_of_two(diag_size)
|
|
|
|
.filter(|&e| e <= max_texture_size)
|
|
|
|
// Limit to max texture resolution rather than error.
|
|
|
|
.unwrap_or(max_texture_size);
|
|
|
|
let depth_stencil_cty = <<ShadowDepthStencilFmt as gfx::format::Formatted>::Channel as gfx::format::ChannelTyped>::get_channel_type();
|
|
|
|
|
|
|
|
let point_shadow_tex = factory
|
|
|
|
.create_texture(
|
|
|
|
gfx::texture::Kind::Cube(diag_two_size / 4),
|
|
|
|
levels as gfx::texture::Level,
|
|
|
|
gfx::memory::Bind::SHADER_RESOURCE | gfx::memory::Bind::DEPTH_STENCIL,
|
|
|
|
gfx::memory::Usage::Data,
|
|
|
|
Some(depth_stencil_cty),
|
|
|
|
)
|
|
|
|
.map_err(|err| RenderError::CombinedError(gfx::CombinedError::Texture(err)))?;
|
|
|
|
|
|
|
|
let point_tgt_shadow_view = factory
|
|
|
|
.view_texture_as_depth_stencil::<ShadowDepthStencilFmt>(
|
|
|
|
&point_shadow_tex,
|
|
|
|
0,
|
|
|
|
None,
|
|
|
|
gfx::texture::DepthStencilFlags::empty(),
|
|
|
|
)?;
|
|
|
|
|
|
|
|
let point_tgt_shadow_res = factory
|
|
|
|
.view_texture_as_shader_resource::<ShadowDepthStencilFmt>(
|
|
|
|
&point_shadow_tex,
|
|
|
|
(0, levels - 1),
|
|
|
|
gfx::format::Swizzle::new(),
|
|
|
|
)?;
|
|
|
|
|
|
|
|
let directed_shadow_tex = factory
|
|
|
|
.create_texture(
|
|
|
|
gfx::texture::Kind::D2(diag_two_size, diag_two_size, gfx::texture::AaMode::Single),
|
|
|
|
levels as gfx::texture::Level,
|
|
|
|
gfx::memory::Bind::SHADER_RESOURCE | gfx::memory::Bind::DEPTH_STENCIL,
|
|
|
|
gfx::memory::Usage::Data,
|
|
|
|
Some(depth_stencil_cty),
|
|
|
|
)
|
|
|
|
.map_err(|err| RenderError::CombinedError(gfx::CombinedError::Texture(err)))?;
|
|
|
|
let directed_tgt_shadow_view = factory
|
|
|
|
.view_texture_as_depth_stencil::<ShadowDepthStencilFmt>(
|
|
|
|
&directed_shadow_tex,
|
|
|
|
0,
|
|
|
|
None,
|
|
|
|
gfx::texture::DepthStencilFlags::empty(),
|
|
|
|
)?;
|
|
|
|
let directed_tgt_shadow_res = factory
|
|
|
|
.view_texture_as_shader_resource::<ShadowDepthStencilFmt>(
|
|
|
|
&directed_shadow_tex,
|
|
|
|
(0, levels - 1),
|
|
|
|
gfx::format::Swizzle::new(),
|
|
|
|
)?;
|
|
|
|
|
|
|
|
let mut sampler_info = gfx::texture::SamplerInfo::new(
|
|
|
|
gfx::texture::FilterMethod::Bilinear,
|
|
|
|
// Lights should always be assumed to flood areas we can't see.
|
|
|
|
gfx::texture::WrapMode::Border,
|
|
|
|
);
|
|
|
|
sampler_info.comparison = Some(Comparison::LessEqual);
|
|
|
|
sampler_info.border = [1.0; 4].into();
|
|
|
|
let point_shadow_tex_sampler = factory.create_sampler(sampler_info);
|
|
|
|
let directed_shadow_tex_sampler = factory.create_sampler(sampler_info);
|
|
|
|
|
|
|
|
Ok((
|
|
|
|
point_tgt_shadow_view,
|
|
|
|
point_tgt_shadow_res,
|
|
|
|
point_shadow_tex_sampler,
|
|
|
|
directed_tgt_shadow_view,
|
|
|
|
directed_tgt_shadow_res,
|
|
|
|
directed_shadow_tex_sampler,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
2019-01-30 12:11:34 +00:00
|
|
|
/// Get the resolution of the render target.
|
|
|
|
pub fn get_resolution(&self) -> Vec2<u16> {
|
|
|
|
Vec2::new(
|
2019-05-07 11:27:40 +00:00
|
|
|
self.win_color_view.get_dimensions().0,
|
|
|
|
self.win_color_view.get_dimensions().1,
|
2019-01-30 12:11:34 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Get the resolution of the shadow render target.
|
|
|
|
pub fn get_shadow_resolution(&self) -> (Vec2<u16>, Vec2<u16>) {
|
|
|
|
if let Some(shadow_map) = &self.shadow_map {
|
|
|
|
let point_dims = shadow_map.point_depth_stencil_view.get_dimensions();
|
|
|
|
let directed_dims = shadow_map.directed_depth_stencil_view.get_dimensions();
|
|
|
|
(
|
|
|
|
Vec2::new(point_dims.0, point_dims.1),
|
|
|
|
Vec2::new(directed_dims.0, directed_dims.1),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(Vec2::new(1, 1), Vec2::new(1, 1))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the clearing of the shadow targets ready for a new frame to be
|
|
|
|
/// rendered.
|
|
|
|
pub fn clear_shadows(&mut self) {
|
2020-09-07 04:59:16 +00:00
|
|
|
span!(_guard, "clear_shadows", "Renderer::clear_shadows");
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
if !self.mode.shadow.is_map() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if let Some(shadow_map) = self.shadow_map.as_mut() {
|
|
|
|
// let point_encoder = &mut shadow_map.point_encoder;
|
|
|
|
let point_encoder = &mut self.encoder;
|
|
|
|
point_encoder.clear_depth(&shadow_map.point_depth_stencil_view, 1.0);
|
|
|
|
// let directed_encoder = &mut shadow_map.directed_encoder;
|
|
|
|
let directed_encoder = &mut self.encoder;
|
|
|
|
directed_encoder.clear_depth(&shadow_map.directed_depth_stencil_view, 1.0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// NOTE: Supported by Vulkan (by default), DirectX 10+ (it seems--it's hard
|
|
|
|
/// to find proof of this, but Direct3D 10 apparently does it by
|
|
|
|
/// default, and 11 definitely does, so I assume it's natively supported
|
|
|
|
/// by DirectX itself), OpenGL 3.2+, and Metal (done by default). While
|
|
|
|
/// there may be some GPUs that don't quite support it correctly, the
|
|
|
|
/// impact is relatively small, so there is no reason not to enable it where
|
|
|
|
/// available.
|
|
|
|
#[allow(unsafe_code)]
|
|
|
|
fn enable_seamless_cube_maps(device: &mut gfx_backend::Device) {
|
|
|
|
unsafe {
|
|
|
|
// NOTE: Currently just fail silently rather than complain if the computer is on
|
|
|
|
// a version lower than 3.2, where seamless cubemaps were introduced.
|
|
|
|
if !device.get_info().is_version_supported(3, 2) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: Safe because GL_TEXTURE_CUBE_MAP_SEAMLESS is supported by OpenGL 3.2+
|
|
|
|
// (see https://www.khronos.org/opengl/wiki/Cubemap_Texture#Seamless_cubemap);
|
|
|
|
// enabling seamless cube maps should always be safe regardless of the state of
|
2020-08-25 12:21:25 +00:00
|
|
|
// the OpenGL context, so no further checks are needed.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
device.with_gl(|gl| {
|
|
|
|
gl.Enable(gfx_gl::TEXTURE_CUBE_MAP_SEAMLESS);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// NOTE: Supported by all but a handful of mobile GPUs
|
|
|
|
/// (see https://github.com/gpuweb/gpuweb/issues/480)
|
|
|
|
/// so wgpu should support it too.
|
|
|
|
#[allow(unsafe_code)]
|
|
|
|
fn set_depth_clamp(device: &mut gfx_backend::Device, depth_clamp: bool) {
|
|
|
|
unsafe {
|
|
|
|
// NOTE: Currently just fail silently rather than complain if the computer is on
|
|
|
|
// a version lower than 3.3, though we probably will complain
|
|
|
|
// elsewhere regardless, since shadow mapping is an optional feature
|
|
|
|
// and having depth clamping disabled won't cause undefined
|
|
|
|
// behavior, just incorrect shadowing from objects behind the viewer.
|
|
|
|
if !device.get_info().is_version_supported(3, 3) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// NOTE: Safe because glDepthClamp is (I believe) supported by
|
|
|
|
// OpenGL 3.3, so we shouldn't have to check for other OpenGL versions which
|
|
|
|
// may use different extensions. Also, enabling depth clamping should
|
|
|
|
// essentially always be safe regardless of the state of the OpenGL
|
|
|
|
// context, so no further checks are needed.
|
|
|
|
device.with_gl(|gl| {
|
|
|
|
if depth_clamp {
|
|
|
|
gl.Enable(gfx_gl::DEPTH_CLAMP);
|
|
|
|
} else {
|
|
|
|
gl.Disable(gfx_gl::DEPTH_CLAMP);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Queue the clearing of the depth target ready for a new frame to be
|
|
|
|
/// rendered.
|
2019-07-04 12:02:26 +00:00
|
|
|
pub fn clear(&mut self) {
|
2020-09-07 04:59:16 +00:00
|
|
|
span!(_guard, "clear", "Renderer::clear");
|
2020-04-04 19:36:55 +00:00
|
|
|
self.encoder.clear_depth(&self.tgt_depth_stencil_view, 1.0);
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
// self.encoder.clear_stencil(&self.tgt_depth_stencil_view, 0);
|
2019-05-06 08:22:47 +00:00
|
|
|
self.encoder.clear_depth(&self.win_depth_view, 1.0);
|
2019-01-07 21:10:31 +00:00
|
|
|
}
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
/// Set up shadow rendering.
|
|
|
|
pub fn start_shadows(&mut self) {
|
|
|
|
if !self.mode.shadow.is_map() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if let Some(_shadow_map) = self.shadow_map.as_mut() {
|
|
|
|
self.encoder.flush(&mut self.device);
|
|
|
|
Self::set_depth_clamp(&mut self.device, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Perform all queued draw calls for global.shadows.
|
|
|
|
pub fn flush_shadows(&mut self) {
|
|
|
|
if !self.mode.shadow.is_map() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if let Some(_shadow_map) = self.shadow_map.as_mut() {
|
|
|
|
let point_encoder = &mut self.encoder;
|
|
|
|
// let point_encoder = &mut shadow_map.point_encoder;
|
|
|
|
point_encoder.flush(&mut self.device);
|
|
|
|
// let directed_encoder = &mut shadow_map.directed_encoder;
|
|
|
|
// directed_encoder.flush(&mut self.device);
|
|
|
|
// Reset depth clamping.
|
|
|
|
Self::set_depth_clamp(&mut self.device, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Perform all queued draw calls for this frame and clean up discarded
|
|
|
|
/// items.
|
2019-01-07 21:10:31 +00:00
|
|
|
pub fn flush(&mut self) {
|
2020-09-07 04:59:16 +00:00
|
|
|
span!(_guard, "flush", "Renderer::flush");
|
2019-01-11 17:30:13 +00:00
|
|
|
self.encoder.flush(&mut self.device);
|
|
|
|
self.device.cleanup();
|
2019-08-03 05:42:33 +00:00
|
|
|
|
|
|
|
// If the shaders files were changed attempt to recreate the shaders
|
|
|
|
if self.shader_reload_indicator.reloaded() {
|
2019-09-26 07:28:40 +00:00
|
|
|
self.recreate_pipelines();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Recreate the pipelines
|
|
|
|
fn recreate_pipelines(&mut self) {
|
|
|
|
match create_pipelines(
|
|
|
|
&mut self.factory,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&self.mode,
|
|
|
|
self.shadow_map.is_some(),
|
2019-09-26 07:28:40 +00:00
|
|
|
&mut self.shader_reload_indicator,
|
|
|
|
) {
|
|
|
|
Ok((
|
|
|
|
skybox_pipeline,
|
|
|
|
figure_pipeline,
|
|
|
|
terrain_pipeline,
|
|
|
|
fluid_pipeline,
|
|
|
|
sprite_pipeline,
|
2020-06-30 14:29:35 +00:00
|
|
|
particle_pipeline,
|
2019-09-26 07:28:40 +00:00
|
|
|
ui_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod_terrain_pipeline,
|
2019-09-26 07:28:40 +00:00
|
|
|
postprocess_pipeline,
|
2020-04-04 19:36:55 +00:00
|
|
|
player_shadow_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
point_shadow_pipeline,
|
|
|
|
terrain_directed_shadow_pipeline,
|
|
|
|
figure_directed_shadow_pipeline,
|
2019-09-26 07:28:40 +00:00
|
|
|
)) => {
|
|
|
|
self.skybox_pipeline = skybox_pipeline;
|
|
|
|
self.figure_pipeline = figure_pipeline;
|
|
|
|
self.terrain_pipeline = terrain_pipeline;
|
|
|
|
self.fluid_pipeline = fluid_pipeline;
|
|
|
|
self.sprite_pipeline = sprite_pipeline;
|
2020-06-30 14:29:35 +00:00
|
|
|
self.particle_pipeline = particle_pipeline;
|
2019-09-26 07:28:40 +00:00
|
|
|
self.ui_pipeline = ui_pipeline;
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
self.lod_terrain_pipeline = lod_terrain_pipeline;
|
2019-09-26 07:28:40 +00:00
|
|
|
self.postprocess_pipeline = postprocess_pipeline;
|
2020-04-04 19:36:55 +00:00
|
|
|
self.player_shadow_pipeline = player_shadow_pipeline;
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
if let (
|
|
|
|
Some(point_pipeline),
|
|
|
|
Some(terrain_directed_pipeline),
|
|
|
|
Some(figure_directed_pipeline),
|
|
|
|
Some(shadow_map),
|
|
|
|
) = (
|
|
|
|
point_shadow_pipeline,
|
|
|
|
terrain_directed_shadow_pipeline,
|
|
|
|
figure_directed_shadow_pipeline,
|
|
|
|
self.shadow_map.as_mut(),
|
|
|
|
) {
|
|
|
|
shadow_map.point_pipeline = point_pipeline;
|
|
|
|
shadow_map.terrain_directed_pipeline = terrain_directed_pipeline;
|
|
|
|
shadow_map.figure_directed_pipeline = figure_directed_pipeline;
|
|
|
|
}
|
2020-02-01 20:39:39 +00:00
|
|
|
},
|
2020-06-21 21:47:49 +00:00
|
|
|
Err(e) => error!(?e, "Could not recreate shaders from assets due to an error",),
|
2019-08-03 05:42:33 +00:00
|
|
|
}
|
2019-01-07 21:10:31 +00:00
|
|
|
}
|
2019-01-11 20:14:37 +00:00
|
|
|
|
2019-01-13 20:53:55 +00:00
|
|
|
/// Create a new set of constants with the provided values.
|
|
|
|
pub fn create_consts<T: Copy + gfx::traits::Pod>(
|
2019-01-12 01:14:58 +00:00
|
|
|
&mut self,
|
2019-01-13 20:53:55 +00:00
|
|
|
vals: &[T],
|
2019-01-12 01:14:58 +00:00
|
|
|
) -> Result<Consts<T>, RenderError> {
|
2019-01-13 20:53:55 +00:00
|
|
|
let mut consts = Consts::new(&mut self.factory, vals.len());
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
consts.update(&mut self.encoder, vals, 0)?;
|
2019-01-11 23:18:34 +00:00
|
|
|
Ok(consts)
|
2019-01-11 20:14:37 +00:00
|
|
|
}
|
|
|
|
|
2019-01-13 20:53:55 +00:00
|
|
|
/// Update a set of constants with the provided values.
|
2019-01-12 01:14:58 +00:00
|
|
|
pub fn update_consts<T: Copy + gfx::traits::Pod>(
|
|
|
|
&mut self,
|
|
|
|
consts: &mut Consts<T>,
|
2019-04-29 20:37:19 +00:00
|
|
|
vals: &[T],
|
2019-01-12 01:14:58 +00:00
|
|
|
) -> Result<(), RenderError> {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
consts.update(&mut self.encoder, vals, 0)
|
2019-01-12 01:14:58 +00:00
|
|
|
}
|
|
|
|
|
2019-08-19 20:09:35 +00:00
|
|
|
/// Create a new set of instances with the provided values.
|
|
|
|
pub fn create_instances<T: Copy + gfx::traits::Pod>(
|
|
|
|
&mut self,
|
|
|
|
vals: &[T],
|
|
|
|
) -> Result<Instances<T>, RenderError> {
|
|
|
|
let mut instances = Instances::new(&mut self.factory, vals.len())?;
|
|
|
|
instances.update(&mut self.encoder, vals)?;
|
|
|
|
Ok(instances)
|
|
|
|
}
|
|
|
|
|
2019-01-11 23:18:34 +00:00
|
|
|
/// Create a new model from the provided mesh.
|
|
|
|
pub fn create_model<P: Pipeline>(&mut self, mesh: &Mesh<P>) -> Result<Model<P>, RenderError> {
|
2019-04-29 20:37:19 +00:00
|
|
|
Ok(Model::new(&mut self.factory, mesh))
|
2019-01-11 20:14:37 +00:00
|
|
|
}
|
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
/// Create a new dynamic model with the specified size.
|
2019-05-04 14:28:21 +00:00
|
|
|
pub fn create_dynamic_model<P: Pipeline>(
|
|
|
|
&mut self,
|
|
|
|
size: usize,
|
|
|
|
) -> Result<DynamicModel<P>, RenderError> {
|
|
|
|
DynamicModel::new(&mut self.factory, size)
|
|
|
|
}
|
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
/// Update a dynamic model with a mesh and a offset.
|
2019-05-04 14:28:21 +00:00
|
|
|
pub fn update_model<P: Pipeline>(
|
|
|
|
&mut self,
|
|
|
|
model: &DynamicModel<P>,
|
|
|
|
mesh: &Mesh<P>,
|
|
|
|
offset: usize,
|
|
|
|
) -> Result<(), RenderError> {
|
|
|
|
model.update(&mut self.encoder, mesh, offset)
|
|
|
|
}
|
|
|
|
|
2019-07-03 01:21:08 +00:00
|
|
|
/// Return the maximum supported texture size.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
pub fn max_texture_size(&self) -> u16 { Self::max_texture_size_raw(&self.factory) }
|
|
|
|
|
|
|
|
/// Return the maximum supported texture size from the factory.
|
|
|
|
fn max_texture_size_raw(factory: &gfx_backend::Factory) -> u16 {
|
|
|
|
/// NOTE: OpenGL requirement.
|
|
|
|
const MAX_TEXTURE_SIZE_MIN: u16 = 1024;
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
/// NOTE: Because Macs lie about their max supported texture size.
|
|
|
|
const MAX_TEXTURE_SIZE_MAX: u16 = 8192;
|
|
|
|
#[cfg(not(target_os = "macos"))]
|
|
|
|
/// NOTE: Apparently Macs aren't the only machines that lie.
|
|
|
|
///
|
|
|
|
/// TODO: Find a way to let graphics cards that don't lie do better.
|
|
|
|
const MAX_TEXTURE_SIZE_MAX: u16 = 8192;
|
|
|
|
// NOTE: Many APIs for textures require coordinates to fit in u16, which is why
|
|
|
|
// we perform this conversion.
|
|
|
|
u16::try_from(factory.get_capabilities().max_texture_size)
|
|
|
|
.unwrap_or(MAX_TEXTURE_SIZE_MIN)
|
|
|
|
.min(MAX_TEXTURE_SIZE_MAX)
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Create a new immutable texture from the provided image.
|
|
|
|
pub fn create_texture_immutable_raw<F: gfx::format::Formatted>(
|
|
|
|
&mut self,
|
|
|
|
kind: gfx::texture::Kind,
|
|
|
|
mipmap: gfx::texture::Mipmap,
|
|
|
|
data: &[&[<F::Surface as gfx::format::SurfaceTyped>::DataType]],
|
|
|
|
sampler_info: gfx::texture::SamplerInfo,
|
|
|
|
) -> Result<Texture<F>, RenderError>
|
|
|
|
where
|
|
|
|
F::Surface: gfx::format::TextureSurface,
|
|
|
|
F::Channel: gfx::format::TextureChannel,
|
|
|
|
<F::Surface as gfx::format::SurfaceTyped>::DataType: Copy,
|
|
|
|
{
|
|
|
|
Texture::new_immutable_raw(&mut self.factory, kind, mipmap, data, sampler_info)
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Create a new raw texture.
|
|
|
|
pub fn create_texture_raw<F: gfx::format::Formatted>(
|
|
|
|
&mut self,
|
|
|
|
kind: gfx::texture::Kind,
|
|
|
|
max_levels: u8,
|
|
|
|
bind: gfx::memory::Bind,
|
|
|
|
usage: gfx::memory::Usage,
|
|
|
|
levels: (u8, u8),
|
|
|
|
swizzle: gfx::format::Swizzle,
|
|
|
|
sampler_info: gfx::texture::SamplerInfo,
|
|
|
|
) -> Result<Texture<F>, RenderError>
|
|
|
|
where
|
|
|
|
F::Surface: gfx::format::TextureSurface,
|
|
|
|
F::Channel: gfx::format::TextureChannel,
|
|
|
|
<F::Surface as gfx::format::SurfaceTyped>::DataType: Copy,
|
|
|
|
{
|
|
|
|
Texture::new_raw(
|
|
|
|
&mut self.device,
|
|
|
|
&mut self.factory,
|
|
|
|
kind,
|
|
|
|
max_levels,
|
|
|
|
bind,
|
|
|
|
usage,
|
|
|
|
levels,
|
|
|
|
swizzle,
|
|
|
|
sampler_info,
|
|
|
|
)
|
|
|
|
}
|
2019-07-03 01:21:08 +00:00
|
|
|
|
2019-01-30 12:11:34 +00:00
|
|
|
/// Create a new texture from the provided image.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
pub fn create_texture<F: gfx::format::Formatted>(
|
2019-04-29 20:37:19 +00:00
|
|
|
&mut self,
|
|
|
|
image: &image::DynamicImage,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
filter_method: Option<FilterMethod>,
|
|
|
|
wrap_mode: Option<WrapMode>,
|
|
|
|
border: Option<gfx::texture::PackedColor>,
|
|
|
|
) -> Result<Texture<F>, RenderError>
|
|
|
|
where
|
|
|
|
F::Surface: gfx::format::TextureSurface,
|
|
|
|
F::Channel: gfx::format::TextureChannel,
|
|
|
|
<F::Surface as gfx::format::SurfaceTyped>::DataType: Copy,
|
|
|
|
{
|
|
|
|
Texture::new(&mut self.factory, image, filter_method, wrap_mode, border)
|
2019-01-30 12:11:34 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Create a new dynamic texture (gfx::memory::Usage::Dynamic) with the
|
|
|
|
/// specified dimensions.
|
2019-11-17 22:41:00 +00:00
|
|
|
pub fn create_dynamic_texture(&mut self, dims: Vec2<u16>) -> Result<Texture, RenderError> {
|
2019-04-29 20:37:19 +00:00
|
|
|
Texture::new_dynamic(&mut self.factory, dims.x, dims.y)
|
2019-02-23 02:41:52 +00:00
|
|
|
}
|
|
|
|
|
2019-05-17 09:22:32 +00:00
|
|
|
/// Update a texture with the provided offset, size, and data.
|
2019-11-17 22:41:00 +00:00
|
|
|
pub fn update_texture(
|
2019-02-23 02:41:52 +00:00
|
|
|
&mut self,
|
2019-11-17 22:41:00 +00:00
|
|
|
texture: &Texture,
|
2019-02-23 02:41:52 +00:00
|
|
|
offset: [u16; 2],
|
|
|
|
size: [u16; 2],
|
2019-04-29 20:37:19 +00:00
|
|
|
data: &[[u8; 4]],
|
2019-02-23 02:41:52 +00:00
|
|
|
) -> Result<(), RenderError> {
|
2019-04-29 20:37:19 +00:00
|
|
|
texture.update(&mut self.encoder, offset, size, data)
|
2019-02-23 02:41:52 +00:00
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Creates a download buffer, downloads the win_color_view, and converts to
|
|
|
|
/// a image::DynamicImage.
|
2020-06-10 19:47:36 +00:00
|
|
|
#[allow(clippy::map_clone)] // TODO: Pending review in #587
|
2019-05-18 21:16:35 +00:00
|
|
|
pub fn create_screenshot(&mut self) -> Result<image::DynamicImage, RenderError> {
|
|
|
|
let (width, height) = self.get_resolution().into_tuple();
|
|
|
|
use gfx::{
|
|
|
|
format::{Formatted, SurfaceTyped},
|
|
|
|
memory::Typed,
|
|
|
|
};
|
|
|
|
type WinSurfaceData = <<WinColorFmt as Formatted>::Surface as SurfaceTyped>::DataType;
|
2019-05-19 16:25:02 +00:00
|
|
|
let download = self
|
2019-05-18 21:16:35 +00:00
|
|
|
.factory
|
2019-09-26 03:19:45 +00:00
|
|
|
.create_download_buffer::<WinSurfaceData>(width as usize * height as usize)?;
|
|
|
|
self.encoder.copy_texture_to_buffer_raw(
|
|
|
|
self.win_color_view.raw().get_texture(),
|
|
|
|
None,
|
|
|
|
gfx::texture::RawImageInfo {
|
|
|
|
xoffset: 0,
|
|
|
|
yoffset: 0,
|
|
|
|
zoffset: 0,
|
|
|
|
width,
|
|
|
|
height,
|
|
|
|
depth: 0,
|
|
|
|
format: WinColorFmt::get_format(),
|
|
|
|
mipmap: 0,
|
|
|
|
},
|
|
|
|
download.raw(),
|
|
|
|
0,
|
|
|
|
)?;
|
2019-05-18 21:16:35 +00:00
|
|
|
self.flush();
|
|
|
|
|
|
|
|
// Assumes that the format is Rgba8.
|
|
|
|
let raw_data = self
|
|
|
|
.factory
|
2019-09-26 03:19:45 +00:00
|
|
|
.read_mapping(&download)?
|
2019-05-18 23:09:23 +00:00
|
|
|
.chunks_exact(width as usize)
|
2019-05-18 21:16:35 +00:00
|
|
|
.rev()
|
|
|
|
.flatten()
|
2019-05-18 23:09:23 +00:00
|
|
|
.flatten()
|
2019-05-18 21:16:35 +00:00
|
|
|
.map(|&e| e)
|
|
|
|
.collect::<Vec<_>>();
|
|
|
|
Ok(image::DynamicImage::ImageRgba8(
|
|
|
|
// Should not fail if the dimensions are correct.
|
|
|
|
image::ImageBuffer::from_raw(width as u32, height as u32, raw_data).unwrap(),
|
|
|
|
))
|
|
|
|
}
|
|
|
|
|
2019-01-12 13:56:34 +00:00
|
|
|
/// Queue the rendering of the provided skybox model in the upcoming frame.
|
2019-01-11 20:14:37 +00:00
|
|
|
pub fn render_skybox(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<skybox::SkyboxPipeline>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
global: &GlobalModel,
|
2019-01-13 20:53:55 +00:00
|
|
|
locals: &Consts<skybox::Locals>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2019-01-11 20:14:37 +00:00
|
|
|
) {
|
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-01-11 20:14:37 +00:00
|
|
|
&self.skybox_pipeline.pso,
|
|
|
|
&skybox::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: locals.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
2019-11-17 22:41:00 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2019-01-11 20:14:37 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
2019-01-11 20:14:37 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
2019-01-13 20:53:55 +00:00
|
|
|
|
|
|
|
/// Queue the rendering of the provided figure model in the upcoming frame.
|
|
|
|
pub fn render_figure(
|
|
|
|
&mut self,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
model: &figure::FigureModel,
|
|
|
|
col_lights: &Texture<ColLightFmt>,
|
|
|
|
global: &GlobalModel,
|
2019-01-13 20:53:55 +00:00
|
|
|
locals: &Consts<figure::Locals>,
|
|
|
|
bones: &Consts<figure::BoneData>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2019-01-13 20:53:55 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
let model = &model.opaque;
|
|
|
|
|
2019-01-13 20:53:55 +00:00
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-01-13 20:53:55 +00:00
|
|
|
&self.figure_pipeline.pso,
|
|
|
|
&figure::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
col_lights: (col_lights.srv.clone(), col_lights.sampler.clone()),
|
2019-01-13 20:53:55 +00:00
|
|
|
locals: locals.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
2019-01-13 20:53:55 +00:00
|
|
|
bones: bones.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
2019-11-17 22:41:00 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2019-01-13 20:53:55 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
2020-04-04 19:36:55 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the rendering of the player silhouette in the upcoming frame.
|
|
|
|
pub fn render_player_shadow(
|
|
|
|
&mut self,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
_model: &figure::FigureModel,
|
|
|
|
_col_lights: &Texture<ColLightFmt>,
|
|
|
|
_global: &GlobalModel,
|
|
|
|
_bones: &Consts<figure::BoneData>,
|
|
|
|
_lod: &lod_terrain::LodData,
|
|
|
|
_locals: &Consts<shadow::Locals>,
|
2020-04-04 19:36:55 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
// FIXME: Consider reenabling at some point.
|
|
|
|
/* let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
let model = &model.opaque;
|
|
|
|
|
2020-04-04 19:36:55 +00:00
|
|
|
self.encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&self.player_shadow_pipeline.pso,
|
|
|
|
&figure::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
col_lights: (col_lights.srv.clone(), col_lights.sampler.clone()),
|
2020-04-04 19:36:55 +00:00
|
|
|
locals: locals.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
2020-04-04 19:36:55 +00:00
|
|
|
bones: bones.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
2020-04-04 19:36:55 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2020-04-04 19:36:55 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (0, 0) */),
|
2020-04-04 19:36:55 +00:00
|
|
|
},
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
); */
|
2020-04-04 19:36:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the rendering of the player model in the upcoming frame.
|
|
|
|
pub fn render_player(
|
|
|
|
&mut self,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
model: &figure::FigureModel,
|
|
|
|
col_lights: &Texture<ColLightFmt>,
|
|
|
|
global: &GlobalModel,
|
2020-04-04 19:36:55 +00:00
|
|
|
locals: &Consts<figure::Locals>,
|
|
|
|
bones: &Consts<figure::BoneData>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2020-04-04 19:36:55 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
let model = &model.opaque;
|
|
|
|
|
2020-04-04 19:36:55 +00:00
|
|
|
self.encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&self.figure_pipeline.pso,
|
|
|
|
&figure::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
col_lights: (col_lights.srv.clone(), col_lights.sampler.clone()),
|
2020-04-04 19:36:55 +00:00
|
|
|
locals: locals.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
2020-04-04 19:36:55 +00:00
|
|
|
bones: bones.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
2020-04-04 19:36:55 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2020-04-04 19:36:55 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
2019-01-13 20:53:55 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
2019-01-14 23:13:58 +00:00
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Queue the rendering of the provided terrain chunk model in the upcoming
|
|
|
|
/// frame.
|
2019-01-14 23:13:58 +00:00
|
|
|
pub fn render_terrain_chunk(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<terrain::TerrainPipeline>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
col_lights: &Texture<ColLightFmt>,
|
|
|
|
global: &GlobalModel,
|
2019-01-14 23:13:58 +00:00
|
|
|
locals: &Consts<terrain::Locals>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2019-01-14 23:13:58 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
2019-01-14 23:13:58 +00:00
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-01-14 23:13:58 +00:00
|
|
|
&self.terrain_pipeline.pso,
|
|
|
|
&terrain::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
// TODO: Consider splitting out texture atlas data into a separate vertex buffer,
|
|
|
|
// since we don't need it for things like global.shadows.
|
|
|
|
col_lights: (col_lights.srv.clone(), col_lights.sampler.clone()),
|
2019-01-14 23:13:58 +00:00
|
|
|
locals: locals.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
2019-11-17 22:41:00 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2019-01-14 23:13:58 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the rendering of a shadow map from a point light in the upcoming
|
|
|
|
/// frame.
|
|
|
|
pub fn render_shadow_point(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<terrain::TerrainPipeline>,
|
|
|
|
global: &GlobalModel,
|
|
|
|
terrain_locals: &Consts<terrain::Locals>,
|
|
|
|
locals: &Consts<shadow::Locals>,
|
|
|
|
) {
|
|
|
|
if !self.mode.shadow.is_map() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// NOTE: Don't render shadows if the shader is not supported.
|
|
|
|
let shadow_map = if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
shadow_map
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
|
|
|
|
// let point_encoder = &mut shadow_map.point_encoder;
|
|
|
|
let point_encoder = &mut self.encoder;
|
|
|
|
point_encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&shadow_map.point_pipeline.pso,
|
|
|
|
&shadow::pipe::Data {
|
|
|
|
// Terrain vertex stuff
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: terrain_locals.buf.clone(),
|
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
|
|
|
|
// Shadow stuff
|
|
|
|
light_shadows: locals.buf.clone(),
|
|
|
|
tgt_depth_stencil: shadow_map.point_depth_stencil_view.clone(),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the rendering of terrain shadow map from all directional lights in
|
|
|
|
/// the upcoming frame.
|
|
|
|
pub fn render_terrain_shadow_directed(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<terrain::TerrainPipeline>,
|
|
|
|
global: &GlobalModel,
|
|
|
|
terrain_locals: &Consts<terrain::Locals>,
|
|
|
|
locals: &Consts<shadow::Locals>,
|
|
|
|
) {
|
|
|
|
if !self.mode.shadow.is_map() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// NOTE: Don't render shadows if the shader is not supported.
|
|
|
|
let shadow_map = if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
shadow_map
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
|
|
|
|
// let directed_encoder = &mut shadow_map.directed_encoder;
|
|
|
|
let directed_encoder = &mut self.encoder;
|
|
|
|
directed_encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&shadow_map.terrain_directed_pipeline.pso,
|
|
|
|
&shadow::pipe::Data {
|
|
|
|
// Terrain vertex stuff
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: terrain_locals.buf.clone(),
|
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
|
|
|
|
// Shadow stuff
|
|
|
|
light_shadows: locals.buf.clone(),
|
|
|
|
tgt_depth_stencil: shadow_map.directed_depth_stencil_view.clone(),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the rendering of figure shadow map from all directional lights in
|
|
|
|
/// the upcoming frame.
|
|
|
|
pub fn render_figure_shadow_directed(
|
|
|
|
&mut self,
|
|
|
|
model: &figure::FigureModel,
|
|
|
|
global: &GlobalModel,
|
|
|
|
figure_locals: &Consts<figure::Locals>,
|
|
|
|
bones: &Consts<figure::BoneData>,
|
|
|
|
locals: &Consts<shadow::Locals>,
|
|
|
|
) {
|
|
|
|
if !self.mode.shadow.is_map() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
// NOTE: Don't render shadows if the shader is not supported.
|
|
|
|
let shadow_map = if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
shadow_map
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
};
|
|
|
|
let model = &model.opaque;
|
|
|
|
|
|
|
|
// let directed_encoder = &mut shadow_map.directed_encoder;
|
|
|
|
let directed_encoder = &mut self.encoder;
|
|
|
|
directed_encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&shadow_map.figure_directed_pipeline.pso,
|
|
|
|
&shadow::figure_pipe::Data {
|
|
|
|
// Terrain vertex stuff
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: figure_locals.buf.clone(),
|
|
|
|
bones: bones.buf.clone(),
|
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
|
|
|
|
// Shadow stuff
|
|
|
|
light_shadows: locals.buf.clone(),
|
|
|
|
tgt_depth_stencil: shadow_map.directed_depth_stencil_view.clone(),
|
2019-01-14 23:13:58 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
2019-01-30 12:11:34 +00:00
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Queue the rendering of the provided terrain chunk model in the upcoming
|
|
|
|
/// frame.
|
2019-08-14 21:28:37 +00:00
|
|
|
pub fn render_fluid_chunk(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<fluid::FluidPipeline>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
global: &GlobalModel,
|
2019-08-14 21:28:37 +00:00
|
|
|
locals: &Consts<terrain::Locals>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2019-11-17 22:41:00 +00:00
|
|
|
waves: &Texture,
|
2019-08-14 21:28:37 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
2019-08-14 21:28:37 +00:00
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-08-14 21:28:37 +00:00
|
|
|
&self.fluid_pipeline.pso,
|
|
|
|
&fluid::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: locals.buf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2019-11-17 22:41:00 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
2019-10-17 16:11:55 +00:00
|
|
|
waves: (waves.srv.clone(), waves.sampler.clone()),
|
2019-08-14 21:28:37 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
2019-08-14 21:28:37 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
/// Queue the rendering of the provided terrain chunk model in the upcoming
|
|
|
|
/// frame.
|
2019-08-19 17:23:47 +00:00
|
|
|
pub fn render_sprites(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<sprite::SpritePipeline>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
col_lights: &Texture<ColLightFmt>,
|
|
|
|
global: &GlobalModel,
|
|
|
|
terrain_locals: &Consts<terrain::Locals>,
|
|
|
|
locals: &Consts<sprite::Locals>,
|
2019-08-19 17:23:47 +00:00
|
|
|
instances: &Instances<sprite::Instance>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2019-08-19 17:23:47 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
2019-08-19 17:23:47 +00:00
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: Some((instances.count() as u32, 0)),
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-08-19 17:23:47 +00:00
|
|
|
&self.sprite_pipeline.pso,
|
|
|
|
&sprite::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
ibuf: instances.ibuf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
col_lights: (col_lights.srv.clone(), col_lights.sampler.clone()),
|
|
|
|
terrain_locals: terrain_locals.buf.clone(),
|
|
|
|
// NOTE: It would be nice if this wasn't needed and we could use a constant buffer
|
|
|
|
// offset into the sprite data. Hopefully, when we switch to wgpu we can do this,
|
|
|
|
// as it offers the exact API we want (the equivalent can be done in OpenGL using
|
|
|
|
// glBindBufferOffset).
|
|
|
|
locals: locals.buf.clone(),
|
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
2019-11-17 22:41:00 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2019-08-19 17:23:47 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Queue the rendering of the provided LoD terrain model in the upcoming
|
|
|
|
/// frame.
|
|
|
|
pub fn render_lod_terrain(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<lod_terrain::LodTerrainPipeline>,
|
|
|
|
global: &GlobalModel,
|
|
|
|
locals: &Consts<lod_terrain::Locals>,
|
|
|
|
lod: &lod_terrain::LodData,
|
|
|
|
) {
|
|
|
|
self.encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&self.lod_terrain_pipeline.pso,
|
|
|
|
&lod_terrain::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: locals.buf.clone(),
|
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
map: (lod.map.srv.clone(), lod.map.sampler.clone()),
|
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
2019-08-19 17:23:47 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-06-30 14:29:35 +00:00
|
|
|
/// Queue the rendering of the provided particle in the upcoming frame.
|
|
|
|
pub fn render_particles(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<particle::ParticlePipeline>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
global: &GlobalModel,
|
2020-06-30 14:29:35 +00:00
|
|
|
instances: &Instances<particle::Instance>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2020-06-30 14:29:35 +00:00
|
|
|
) {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let (point_shadow_maps, directed_shadow_maps) =
|
|
|
|
if let Some(shadow_map) = &mut self.shadow_map {
|
|
|
|
(
|
|
|
|
(
|
|
|
|
shadow_map.point_res.clone(),
|
|
|
|
shadow_map.point_sampler.clone(),
|
|
|
|
),
|
|
|
|
(
|
|
|
|
shadow_map.directed_res.clone(),
|
|
|
|
shadow_map.directed_sampler.clone(),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
(
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
(self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
|
|
|
)
|
|
|
|
};
|
|
|
|
|
2020-06-30 14:29:35 +00:00
|
|
|
self.encoder.draw(
|
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: Some((instances.count() as u32, 0)),
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
|
|
|
&self.particle_pipeline.pso,
|
|
|
|
&particle::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
ibuf: instances.ibuf.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
globals: global.globals.buf.clone(),
|
|
|
|
lights: global.lights.buf.clone(),
|
|
|
|
shadows: global.shadows.buf.clone(),
|
|
|
|
light_shadows: global.shadow_mats.buf.clone(),
|
|
|
|
point_shadow_maps,
|
|
|
|
directed_shadow_maps,
|
2020-06-30 14:29:35 +00:00
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
2020-06-30 14:29:35 +00:00
|
|
|
tgt_color: self.tgt_color_view.clone(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (self.tgt_depth_stencil_view.clone()/* , (1, 1) */),
|
2020-06-30 14:29:35 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-01-30 12:11:34 +00:00
|
|
|
/// Queue the rendering of the provided UI element in the upcoming frame.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
pub fn render_ui_element<F: gfx::format::Formatted<View = [f32; 4]>>(
|
2019-01-30 12:11:34 +00:00
|
|
|
&mut self,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
model: Model<ui::UiPipeline>,
|
|
|
|
tex: &Texture<F>,
|
2019-03-20 05:13:42 +00:00
|
|
|
scissor: Aabr<u16>,
|
2019-05-14 06:43:07 +00:00
|
|
|
globals: &Consts<Globals>,
|
|
|
|
locals: &Consts<ui::Locals>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
) where
|
|
|
|
F::Surface: gfx::format::TextureSurface,
|
|
|
|
F::Channel: gfx::format::TextureChannel,
|
|
|
|
<F::Surface as gfx::format::SurfaceTyped>::DataType: Copy,
|
|
|
|
{
|
2019-03-20 05:13:42 +00:00
|
|
|
let Aabr { min, max } = scissor;
|
2019-01-30 12:11:34 +00:00
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
start: model.vertex_range.start,
|
|
|
|
end: model.vertex_range.end,
|
2019-08-19 21:54:16 +00:00
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-01-30 12:11:34 +00:00
|
|
|
&self.ui_pipeline.pso,
|
|
|
|
&ui::pipe::Data {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
vbuf: model.vbuf,
|
2019-04-29 20:37:19 +00:00
|
|
|
scissor: gfx::Rect {
|
|
|
|
x: min.x,
|
|
|
|
y: min.y,
|
|
|
|
w: max.x - min.x,
|
|
|
|
h: max.y - min.y,
|
|
|
|
},
|
2019-01-30 12:11:34 +00:00
|
|
|
tex: (tex.srv.clone(), tex.sampler.clone()),
|
2019-05-14 06:43:07 +00:00
|
|
|
locals: locals.buf.clone(),
|
|
|
|
globals: globals.buf.clone(),
|
2019-05-06 08:22:47 +00:00
|
|
|
tgt_color: self.win_color_view.clone(),
|
|
|
|
tgt_depth: self.win_depth_view.clone(),
|
2019-01-30 12:11:34 +00:00
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
2019-05-06 08:22:47 +00:00
|
|
|
|
|
|
|
pub fn render_post_process(
|
|
|
|
&mut self,
|
|
|
|
model: &Model<postprocess::PostProcessPipeline>,
|
|
|
|
globals: &Consts<Globals>,
|
|
|
|
locals: &Consts<postprocess::Locals>,
|
2020-10-21 21:05:25 +00:00
|
|
|
lod: &lod_terrain::LodData,
|
2019-05-06 08:22:47 +00:00
|
|
|
) {
|
|
|
|
self.encoder.draw(
|
2019-08-19 21:54:16 +00:00
|
|
|
&gfx::Slice {
|
|
|
|
start: model.vertex_range().start,
|
|
|
|
end: model.vertex_range().end,
|
|
|
|
base_vertex: 0,
|
|
|
|
instances: None,
|
|
|
|
buffer: gfx::IndexBuffer::Auto,
|
|
|
|
},
|
2019-05-06 08:22:47 +00:00
|
|
|
&self.postprocess_pipeline.pso,
|
|
|
|
&postprocess::pipe::Data {
|
|
|
|
vbuf: model.vbuf.clone(),
|
|
|
|
locals: locals.buf.clone(),
|
|
|
|
globals: globals.buf.clone(),
|
2020-10-21 21:05:25 +00:00
|
|
|
map: (lod.map.srv.clone(), lod.map.sampler.clone()),
|
|
|
|
alt: (lod.alt.srv.clone(), lod.alt.sampler.clone()),
|
|
|
|
horizon: (lod.horizon.srv.clone(), lod.horizon.sampler.clone()),
|
|
|
|
color_sampler: (self.tgt_color_res.clone(), self.sampler.clone()),
|
|
|
|
depth_sampler: (self.tgt_depth_res.clone(), self.sampler.clone()),
|
|
|
|
noise: (self.noise_tex.srv.clone(), self.noise_tex.sampler.clone()),
|
2019-05-06 08:22:47 +00:00
|
|
|
tgt_color: self.win_color_view.clone(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
2019-01-11 20:14:37 +00:00
|
|
|
}
|
|
|
|
|
2019-01-11 23:18:34 +00:00
|
|
|
struct GfxPipeline<P: gfx::pso::PipelineInit> {
|
2019-01-11 20:14:37 +00:00
|
|
|
pso: gfx::pso::PipelineState<gfx_backend::Resources, P::Meta>,
|
2019-01-07 21:10:31 +00:00
|
|
|
}
|
2019-01-11 23:18:34 +00:00
|
|
|
|
2019-08-15 20:38:13 +00:00
|
|
|
/// Creates all the pipelines used to render.
|
2020-06-10 19:47:36 +00:00
|
|
|
#[allow(clippy::type_complexity)] // TODO: Pending review in #587
|
2019-08-03 05:42:33 +00:00
|
|
|
fn create_pipelines(
|
|
|
|
factory: &mut gfx_backend::Factory,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
mode: &RenderMode,
|
|
|
|
has_shadow_views: bool,
|
2019-08-03 05:42:33 +00:00
|
|
|
shader_reload_indicator: &mut ReloadIndicator,
|
|
|
|
) -> Result<
|
|
|
|
(
|
|
|
|
GfxPipeline<skybox::pipe::Init<'static>>,
|
|
|
|
GfxPipeline<figure::pipe::Init<'static>>,
|
|
|
|
GfxPipeline<terrain::pipe::Init<'static>>,
|
2019-08-14 21:28:37 +00:00
|
|
|
GfxPipeline<fluid::pipe::Init<'static>>,
|
2019-08-19 17:01:23 +00:00
|
|
|
GfxPipeline<sprite::pipe::Init<'static>>,
|
2020-06-30 14:29:35 +00:00
|
|
|
GfxPipeline<particle::pipe::Init<'static>>,
|
2019-08-03 05:42:33 +00:00
|
|
|
GfxPipeline<ui::pipe::Init<'static>>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
GfxPipeline<lod_terrain::pipe::Init<'static>>,
|
2019-08-03 05:42:33 +00:00
|
|
|
GfxPipeline<postprocess::pipe::Init<'static>>,
|
2020-04-04 19:36:55 +00:00
|
|
|
GfxPipeline<figure::pipe::Init<'static>>,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
Option<GfxPipeline<shadow::pipe::Init<'static>>>,
|
|
|
|
Option<GfxPipeline<shadow::pipe::Init<'static>>>,
|
|
|
|
Option<GfxPipeline<shadow::figure_pipe::Init<'static>>>,
|
2019-08-03 05:42:33 +00:00
|
|
|
),
|
|
|
|
RenderError,
|
|
|
|
> {
|
2020-08-28 01:02:17 +00:00
|
|
|
let constants =
|
|
|
|
Glsl::load_watched("voxygen.shaders.include.constants", shader_reload_indicator).unwrap();
|
2019-08-03 05:42:33 +00:00
|
|
|
let globals =
|
2020-08-28 01:02:17 +00:00
|
|
|
Glsl::load_watched("voxygen.shaders.include.globals", shader_reload_indicator).unwrap();
|
|
|
|
let sky = Glsl::load_watched("voxygen.shaders.include.sky", shader_reload_indicator).unwrap();
|
2019-08-03 05:42:33 +00:00
|
|
|
let light =
|
2020-08-28 01:02:17 +00:00
|
|
|
Glsl::load_watched("voxygen.shaders.include.light", shader_reload_indicator).unwrap();
|
|
|
|
let srgb = Glsl::load_watched("voxygen.shaders.include.srgb", shader_reload_indicator).unwrap();
|
2019-08-15 01:35:56 +00:00
|
|
|
let random =
|
2020-08-28 01:02:17 +00:00
|
|
|
Glsl::load_watched("voxygen.shaders.include.random", shader_reload_indicator).unwrap();
|
|
|
|
let lod = Glsl::load_watched("voxygen.shaders.include.lod", shader_reload_indicator).unwrap();
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let shadows =
|
2020-08-28 01:02:17 +00:00
|
|
|
Glsl::load_watched("voxygen.shaders.include.shadows", shader_reload_indicator).unwrap();
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
|
|
|
|
// We dynamically add extra configuration settings to the constants file.
|
|
|
|
let constants = format!(
|
|
|
|
r#"
|
|
|
|
{}
|
|
|
|
|
2020-08-25 12:21:25 +00:00
|
|
|
#define VOXYGEN_COMPUTATION_PREFERENCE {}
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
#define FLUID_MODE {}
|
|
|
|
#define CLOUD_MODE {}
|
|
|
|
#define LIGHTING_ALGORITHM {}
|
|
|
|
#define SHADOW_MODE {}
|
|
|
|
|
|
|
|
"#,
|
|
|
|
constants,
|
|
|
|
// TODO: Configurable vertex/fragment shader preference.
|
2020-08-25 12:21:25 +00:00
|
|
|
"VOXYGEN_COMPUTATION_PREFERENCE_FRAGMENT",
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
match mode.fluid {
|
|
|
|
FluidMode::Cheap => "FLUID_MODE_CHEAP",
|
|
|
|
FluidMode::Shiny => "FLUID_MODE_SHINY",
|
|
|
|
},
|
|
|
|
match mode.cloud {
|
|
|
|
CloudMode::None => "CLOUD_MODE_NONE",
|
2020-10-21 21:05:25 +00:00
|
|
|
CloudMode::Minimal => "CLOUD_MODE_MINIMAL",
|
|
|
|
CloudMode::Low => "CLOUD_MODE_LOW",
|
|
|
|
CloudMode::Medium => "CLOUD_MODE_MEDIUM",
|
|
|
|
CloudMode::High => "CLOUD_MODE_HIGH",
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
},
|
|
|
|
match mode.lighting {
|
|
|
|
LightingMode::Ashikhmin => "LIGHTING_ALGORITHM_ASHIKHMIN",
|
|
|
|
LightingMode::BlinnPhong => "LIGHTING_ALGORITHM_BLINN_PHONG",
|
2020-10-21 21:05:25 +00:00
|
|
|
LightingMode::Lambertian => "LIGHTING_ALGORITHM_LAMBERTIAN",
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
},
|
|
|
|
match mode.shadow {
|
|
|
|
ShadowMode::None => "SHADOW_MODE_NONE",
|
|
|
|
ShadowMode::Map(_) if has_shadow_views => "SHADOW_MODE_MAP",
|
|
|
|
ShadowMode::Cheap | ShadowMode::Map(_) => "SHADOW_MODE_CHEAP",
|
|
|
|
},
|
|
|
|
);
|
2019-08-03 05:42:33 +00:00
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
let anti_alias = Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&["voxygen.shaders.antialias.", match mode.aa {
|
2020-02-01 20:39:39 +00:00
|
|
|
AaMode::None | AaMode::SsaaX4 => "none",
|
|
|
|
AaMode::Fxaa => "fxaa",
|
|
|
|
AaMode::MsaaX4 => "msaa-x4",
|
|
|
|
AaMode::MsaaX8 => "msaa-x8",
|
|
|
|
AaMode::MsaaX16 => "msaa-x16",
|
|
|
|
}]
|
2019-09-26 07:28:40 +00:00
|
|
|
.concat(),
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
let cloud = Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&["voxygen.shaders.include.cloud.", match mode.cloud {
|
2020-02-01 20:39:39 +00:00
|
|
|
CloudMode::None => "none",
|
2020-10-21 21:05:25 +00:00
|
|
|
_ => "regular",
|
2020-02-01 20:39:39 +00:00
|
|
|
}]
|
2020-01-19 03:58:25 +00:00
|
|
|
.concat(),
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
|
2019-08-03 05:42:33 +00:00
|
|
|
let mut include_ctx = IncludeContext::new();
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
include_ctx.include("constants.glsl", &constants);
|
2019-08-03 05:42:33 +00:00
|
|
|
include_ctx.include("globals.glsl", &globals);
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
include_ctx.include("shadows.glsl", &shadows);
|
2019-08-03 05:42:33 +00:00
|
|
|
include_ctx.include("sky.glsl", &sky);
|
|
|
|
include_ctx.include("light.glsl", &light);
|
2019-08-04 19:54:08 +00:00
|
|
|
include_ctx.include("srgb.glsl", &srgb);
|
2019-08-15 01:35:56 +00:00
|
|
|
include_ctx.include("random.glsl", &random);
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
include_ctx.include("lod.glsl", &lod);
|
2019-09-26 07:28:40 +00:00
|
|
|
include_ctx.include("anti-aliasing.glsl", &anti_alias);
|
2020-01-19 03:58:25 +00:00
|
|
|
include_ctx.include("cloud.glsl", &cloud);
|
2019-08-03 05:42:33 +00:00
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let figure_vert =
|
2020-08-28 01:02:17 +00:00
|
|
|
Glsl::load_watched("voxygen.shaders.figure-vert", shader_reload_indicator).unwrap();
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
let terrain_point_shadow_vert = Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
"voxygen.shaders.light-shadows-vert",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
let terrain_directed_shadow_vert = Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
"voxygen.shaders.light-shadows-directed-vert",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
let figure_directed_shadow_vert = Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
"voxygen.shaders.light-shadows-figure-vert",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
|
2020-08-28 01:02:17 +00:00
|
|
|
let directed_shadow_frag = Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
"voxygen.shaders.light-shadows-directed-frag",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap();
|
|
|
|
|
2019-08-03 05:42:33 +00:00
|
|
|
// Construct a pipeline for rendering skyboxes
|
|
|
|
let skybox_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
skybox::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.skybox-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.skybox-frag", shader_reload_indicator).unwrap(),
|
2019-08-03 05:42:33 +00:00
|
|
|
&include_ctx,
|
2019-08-15 01:35:56 +00:00
|
|
|
gfx::state::CullFace::Back,
|
2019-08-03 05:42:33 +00:00
|
|
|
)?;
|
|
|
|
|
|
|
|
// Construct a pipeline for rendering figures
|
|
|
|
let figure_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
figure::pipe::new(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&figure_vert,
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.figure-frag", shader_reload_indicator).unwrap(),
|
2019-08-03 05:42:33 +00:00
|
|
|
&include_ctx,
|
2019-08-15 01:35:56 +00:00
|
|
|
gfx::state::CullFace::Back,
|
2019-08-03 05:42:33 +00:00
|
|
|
)?;
|
|
|
|
|
|
|
|
// Construct a pipeline for rendering terrain
|
|
|
|
let terrain_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
terrain::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.terrain-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.terrain-frag", shader_reload_indicator).unwrap(),
|
2019-08-03 05:42:33 +00:00
|
|
|
&include_ctx,
|
2019-08-15 01:35:56 +00:00
|
|
|
gfx::state::CullFace::Back,
|
2019-08-03 05:42:33 +00:00
|
|
|
)?;
|
|
|
|
|
2019-08-14 21:28:37 +00:00
|
|
|
// Construct a pipeline for rendering fluids
|
|
|
|
let fluid_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
fluid::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.fluid-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&["voxygen.shaders.fluid-frag.", match mode.fluid {
|
2020-02-01 20:39:39 +00:00
|
|
|
FluidMode::Cheap => "cheap",
|
|
|
|
FluidMode::Shiny => "shiny",
|
|
|
|
}]
|
2020-01-19 03:58:25 +00:00
|
|
|
.concat(),
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap(),
|
2019-08-14 21:28:37 +00:00
|
|
|
&include_ctx,
|
2019-08-15 01:35:56 +00:00
|
|
|
gfx::state::CullFace::Nothing,
|
2019-08-14 21:28:37 +00:00
|
|
|
)?;
|
|
|
|
|
2019-08-19 17:01:23 +00:00
|
|
|
// Construct a pipeline for rendering sprites
|
|
|
|
let sprite_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
sprite::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.sprite-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.sprite-frag", shader_reload_indicator).unwrap(),
|
2019-08-19 17:01:23 +00:00
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
)?;
|
|
|
|
|
2020-07-25 15:56:50 +00:00
|
|
|
// Construct a pipeline for rendering particles
|
|
|
|
let particle_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
particle::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.particle-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.particle-frag", shader_reload_indicator).unwrap(),
|
2020-07-25 15:56:50 +00:00
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
)?;
|
2020-06-30 14:29:35 +00:00
|
|
|
|
2019-08-03 05:42:33 +00:00
|
|
|
// Construct a pipeline for rendering UI elements
|
|
|
|
let ui_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
ui::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.ui-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.ui-frag", shader_reload_indicator).unwrap(),
|
2019-08-03 05:42:33 +00:00
|
|
|
&include_ctx,
|
2019-08-15 01:35:56 +00:00
|
|
|
gfx::state::CullFace::Back,
|
2019-08-03 05:42:33 +00:00
|
|
|
)?;
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
// Construct a pipeline for rendering terrain
|
|
|
|
let lod_terrain_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
lod_terrain::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.lod-terrain-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.lod-terrain-frag", shader_reload_indicator).unwrap(),
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
)?;
|
|
|
|
|
2019-08-03 05:42:33 +00:00
|
|
|
// Construct a pipeline for rendering our post-processing
|
|
|
|
let postprocess_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
postprocess::pipe::new(),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched("voxygen.shaders.postprocess-vert", shader_reload_indicator).unwrap(),
|
|
|
|
&Glsl::load_watched("voxygen.shaders.postprocess-frag", shader_reload_indicator).unwrap(),
|
2019-08-03 05:42:33 +00:00
|
|
|
&include_ctx,
|
2019-08-15 01:35:56 +00:00
|
|
|
gfx::state::CullFace::Back,
|
2019-08-03 05:42:33 +00:00
|
|
|
)?;
|
|
|
|
|
2020-04-04 19:36:55 +00:00
|
|
|
// Construct a pipeline for rendering the player silhouette
|
|
|
|
let player_shadow_pipeline = create_pipeline(
|
|
|
|
factory,
|
|
|
|
figure::pipe::Init {
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
tgt_depth_stencil: (gfx::preset::depth::PASS_TEST/*,
|
|
|
|
Stencil::new(
|
|
|
|
Comparison::Equal,
|
|
|
|
0xff,
|
|
|
|
(StencilOp::Keep, StencilOp::Keep, StencilOp::Keep),
|
|
|
|
),*/),
|
2020-04-04 19:36:55 +00:00
|
|
|
..figure::pipe::new()
|
|
|
|
},
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
&figure_vert,
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched(
|
2020-04-04 19:36:55 +00:00
|
|
|
"voxygen.shaders.player-shadow-frag",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap(),
|
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
)?;
|
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
// Construct a pipeline for rendering point light terrain shadow maps.
|
|
|
|
let point_shadow_pipeline = match create_shadow_pipeline(
|
|
|
|
factory,
|
|
|
|
shadow::pipe::new(),
|
|
|
|
&terrain_point_shadow_vert,
|
|
|
|
Some(
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
"voxygen.shaders.light-shadows-geom",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap(),
|
|
|
|
),
|
2020-08-28 01:02:17 +00:00
|
|
|
&Glsl::load_watched(
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
"voxygen.shaders.light-shadows-frag",
|
|
|
|
shader_reload_indicator,
|
|
|
|
)
|
|
|
|
.unwrap(),
|
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
None, // Some(gfx::state::Offset(2, 0))
|
|
|
|
) {
|
|
|
|
Ok(pipe) => Some(pipe),
|
|
|
|
Err(err) => {
|
|
|
|
warn!("Could not load point shadow map pipeline: {:?}", err);
|
|
|
|
None
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
// Construct a pipeline for rendering directional light terrain shadow maps.
|
|
|
|
let terrain_directed_shadow_pipeline = match create_shadow_pipeline(
|
|
|
|
factory,
|
|
|
|
shadow::pipe::new(),
|
|
|
|
&terrain_directed_shadow_vert,
|
|
|
|
None,
|
|
|
|
&directed_shadow_frag,
|
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
None, // Some(gfx::state::Offset(2, 1))
|
|
|
|
) {
|
|
|
|
Ok(pipe) => Some(pipe),
|
|
|
|
Err(err) => {
|
|
|
|
warn!(
|
|
|
|
"Could not load directed terrain shadow map pipeline: {:?}",
|
|
|
|
err
|
|
|
|
);
|
|
|
|
None
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
// Construct a pipeline for rendering directional light figure shadow maps.
|
|
|
|
let figure_directed_shadow_pipeline = match create_shadow_pipeline(
|
|
|
|
factory,
|
|
|
|
shadow::figure_pipe::new(),
|
|
|
|
&figure_directed_shadow_vert,
|
|
|
|
None,
|
|
|
|
&directed_shadow_frag,
|
|
|
|
&include_ctx,
|
|
|
|
gfx::state::CullFace::Back,
|
|
|
|
None, // Some(gfx::state::Offset(2, 1))
|
|
|
|
) {
|
|
|
|
Ok(pipe) => Some(pipe),
|
|
|
|
Err(err) => {
|
|
|
|
warn!(
|
|
|
|
"Could not load directed figure shadow map pipeline: {:?}",
|
|
|
|
err
|
|
|
|
);
|
|
|
|
None
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-08-03 05:42:33 +00:00
|
|
|
Ok((
|
|
|
|
skybox_pipeline,
|
|
|
|
figure_pipeline,
|
|
|
|
terrain_pipeline,
|
2019-08-14 21:28:37 +00:00
|
|
|
fluid_pipeline,
|
2019-08-19 17:01:23 +00:00
|
|
|
sprite_pipeline,
|
2020-06-30 14:29:35 +00:00
|
|
|
particle_pipeline,
|
2019-08-03 05:42:33 +00:00
|
|
|
ui_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
lod_terrain_pipeline,
|
2019-08-03 05:42:33 +00:00
|
|
|
postprocess_pipeline,
|
2020-04-04 19:36:55 +00:00
|
|
|
player_shadow_pipeline,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
point_shadow_pipeline,
|
|
|
|
terrain_directed_shadow_pipeline,
|
|
|
|
figure_directed_shadow_pipeline,
|
2019-08-03 05:42:33 +00:00
|
|
|
))
|
|
|
|
}
|
|
|
|
|
2019-01-12 13:56:34 +00:00
|
|
|
/// Create a new pipeline from the provided vertex shader and fragment shader.
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
fn create_pipeline<P: gfx::pso::PipelineInit>(
|
2019-01-11 23:18:34 +00:00
|
|
|
factory: &mut gfx_backend::Factory,
|
|
|
|
pipe: P,
|
2019-05-12 09:10:13 +00:00
|
|
|
vs: &str,
|
|
|
|
fs: &str,
|
|
|
|
ctx: &IncludeContext,
|
2019-08-15 01:35:56 +00:00
|
|
|
cull_face: gfx::state::CullFace,
|
2019-01-11 23:18:34 +00:00
|
|
|
) -> Result<GfxPipeline<P>, RenderError> {
|
2019-09-26 03:19:45 +00:00
|
|
|
let vs = ctx.expand(vs)?;
|
|
|
|
let fs = ctx.expand(fs)?;
|
2019-05-12 09:10:13 +00:00
|
|
|
|
2019-09-26 03:19:45 +00:00
|
|
|
let program = factory.link_program(vs.as_bytes(), fs.as_bytes())?;
|
2019-01-11 23:18:34 +00:00
|
|
|
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
let result = Ok(GfxPipeline {
|
2019-09-26 03:19:45 +00:00
|
|
|
pso: factory.create_pipeline_from_program(
|
|
|
|
&program,
|
|
|
|
gfx::Primitive::TriangleList,
|
|
|
|
gfx::state::Rasterizer {
|
|
|
|
front_face: gfx::state::FrontFace::CounterClockwise,
|
|
|
|
cull_face,
|
|
|
|
method: gfx::state::RasterMethod::Fill,
|
|
|
|
offset: None,
|
|
|
|
samples: Some(gfx::state::MultiSample),
|
|
|
|
},
|
|
|
|
pipe,
|
2019-09-27 03:40:58 +00:00
|
|
|
)?,
|
(See sharp/lod-history) LOD, shadows, greedy meshing, new lighting, perf
---
Pretty much a Veloren fork at this point. Here's a high level overview of the changes (will be added to CHANGELOG just before merge).
At a high level this MR incorporates roughly two groups of changes.
The first group consists of new game features: more flexible map sizes, level of detail terrain, shadow maps, and a new lighting
engine. This is "feature work" that (mostly) only adds new things to Veloren, and mostly shouldn't affect old stuff.
The second big group of changes are those addressing the fallout from all the new features. These include performance fixes of
various sorts: the addition of multiple graphics options and optimization of the cheap ones to avoid work, switching all voxel
models to use some variant of greedy meshing, switching over much of our CPU-side vector math to exploit SIMD instructions
(coinciding with a fork of `vek`), and a rewrite of how the UI handles text rendering (coinciding with updates to our fork
of `conrod`). Making Veloren's hardcoded colors appear correct under the new lighting engine also required considerably
changes (TODO: Fill in this section when it's complete).
The second category of changes often heavily touches code owned by other people, including frequently modified code "owned" by a
handful of people, so I recommend that this code be reviewed particularly carefully.
---
At a high level (each will be described in more detail below):
- The world map has been refactored.
- The world size is no longer hardcoded (@zesterer).
- The map generation code was made generic to allow using it outside of the `world` crate (@zesterer).
- On world creation, we now compute *horizon maps* (@zesterer).
- The way we pass the world from the server to the client has been updated (@xMAC94x).
- Artifacts related to image rotation were fixed (@imbris).
- Multiflow rivers were enabled (@zesterer).
- In the process of making changes related to the world map, various incidental fixes and optimizations were required.
- The new *level of detail* feature was added (@zesterer wrote part of this and has checked out the rest).
- A new LOD terrain rendering step was added to the pipeline.
- The LOD terrain quality was made configurable via a graphics setting.
- Horizon maps were used to cast shadows from LOD chunks on both LOD and non-LOD terrain.
- A "voxelization" effect was incorporated into rendered LOD terrain to make it blend better into the world.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Veloren's lighting has been completely overhauled (@zesterer has already checked most of this out).
- A semi-accurate index of refraction was assigned to our materials.
- A new, more realistic, physically based approach to lighting was used using the *Ashikhmin Shirley* BRDF.
- We emulate *atmospheric scattering* using equations designed for measuring solar panel light exposure.
- We attempt to compute *realistic light attenuation* in water using its real material properties.
- In the process of making changes related to LOD, various incidental fixes and optimizations were required.
- Point and directional lights now cast realistic shadows, using *shadow mapping.* (@imbris, @zesterer, @Treeco, @YuriMomo)
- Point light shadow maps were added to the rendering pipeline, using geometry shaders and *seamless cube maps*.
- Directional light shadows were added to the rendering pipeline, using LISPSM together with disabling *depth clamping*.
- "Shadow-only" chunks and NPCs were added to prevent shadows from models behind you from disappearing.
- In the process of making changes related to shadow maps, various incidental fixes and optimizations were required.
The addition of shadow maps, LOD terrain, and the new lighting all led to significant performance degradation, on top of other
changes happening in master. Therefore, a large number of performance improvements were also needed:
- The graphics options were made much more flexible and configurable, and shaders were optimize.
- New options were provided for how to render lights and shadows (@Pfauenauge, @zesterer).
- Graphic setting storage and configuration were overhauled to make adding new features easier (@Pfauenauge, @imbris).
- Shaders were rewritten to utilize GLSL's preprocessor to avoid overhead (@zesterer, @YuriMomo).
- In the process of making changes related to providing additional rendering options, various incidental fixes and optimizations were required.
- Voxel model creation was switched to use *greedy meshing.*
- A new voxel meshing method, greedy meshing, was added (@imbris).
- Uses of the older meshing methods were migrated to use greedy meshing (@imbris, @jshipsey, @Pfauenauge).
- New restrictions were added to terrain, figure, and sprites to future proof them for further optimizations (@jshipsey, @Pfauenauge, @zesterer).
- Most positions are now relative to either chunk or player position for better precision (@imbris, @zesterer, @scottc).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- Animation and terrain math were switched to use SIMD where possible.
- Fixes were made to vek to make its SIMD feature usable for us (@zesterer, @imbris).
- The interface and types used in bone animation were changed in various ways (@jshipsey, @Snowram, @Pfauenauge).
- Redundant code generation for body animation is now partly taken care of by a macro (@jshipsey, @Snowram, @Pfauenauge).
- Animation code was modified to to use vek's SIMD representation where possible (@jshipsey, @Snowram, @Pfauenauge).
- Terrain meshing code and shadow map math were also modified to use vek's SIMD representation (@imbris).
- SIMD instruction generation was enabled (@YuriMomo, @jshipsey, @Snowram, @imbris, @Angelonfira, @xMAC94x).
- In the process of making changes related to greedy meshing, various incidental fixes and optimizations were required.
- The way we cache glyphs was completely refactored, fixed, and optimized.
- Our fork of `conrod` was optimized in various ways (@imbris).
- Our fork of `conrod` now exposes whether a widget was updated during the current frame (@imbris).
- Our use of the glyph cache was rewritten for correctness (@imbris).
- A *text cache* was introduced that lets us skip remeshing glyphs that have not changed (@imbris).
- Various changes were made to reduce pressure on the glyph cache, with more planned (@imbris, @Pfauenauge).
- In the process of making changes related to the glyph cache, various incidental fixes and optimizations were required.
- Colors were changed to keep Veloren's look consistent with master.
- Some older tree models were brought back (@Pfauenauge).
- TODO(@Sharp): All hardcoded colors were extracted and made hotloadable.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Hardcoded colors were fixed to conform to Veloren's style.
- TODO(@Treeco, @Pfauenauge, @imbris, @jshipsey): Color models were fixed to conform to Veloren's style.
A detailed description of the involved changes follows.
---
- The world size is no longer hardcoded. All functions dependent on world size now take a `WorldSizeLg`, which holds the base 2 logarithm of each actual world dimension and is guaranteed to maintain certain properties (outlined in `common/src/terrain/map.rs`). Additionally, many utility functions that utilize the world size were moved into `common` as well (mostly `common/src/terrain/mod.rs`). Finally, the world map format was updated in order to store its size explicitly, with a migration path from the old format that should work whenever the old formatted map was a square (practically always). See `world/src/sim/mod.rs` for these changes.
- The map generation code was made generic to allow using it outside of the `world` crate. The parts of the map generating code that do not need to query the world were moved over to `common/src/terrain/map.rs`, allowing them to be used from the client without creating a dependency on `world`. The rest of it was turned into helper functions in `world/src/sim/map.rs`, which can be passed as closures to the generic map generation code to complete its construction. This also means that colors are now passed in separately to the map generation function. See <https://veloren.net/devblog-78/> for more details.
- On world creation, we now compute *horizon maps*. See the function in `world/src/sim/util.rs`.
Given a height map and a plane intersecting that height map, our horizon maps allow us to encode enough information to reconstruct shadows for each point on the height map using only the *horizon angle* (the angle at which the sun starts to become visible). As Veloren's sun only covers one plane, this is sufficient for encoding sun shadows for LOD terrain, by encoding two angles per chunk (one for each 90 degrees the sun covers). We can also use this for the moon, if we want, since the moon follows the same path. Additionally, we store the *height* of the furthest occluder, to try to make the shadows volumetric; so this means 4 bytes in total for each chunk.
Support for horizon maps has been merged into the map functionality in common as well.
- The way we pass the world from the server to the client has been updated. Rather than passing the prerendered map, we instead pass three maps with values for each chunk; one with the color information, a second with altitude information, and a third with horizon map information. We then reconstruct the map on the client, together with some additional information we send from the server (like the sea level and maximum height). See `common/src/msg/server.rs` for a detailed description of the format of `WorldMapMsg`, and `server/src/libr.rs` and `client/src/lib.rs` for details of the map construction and parsing.
- Artifacts related to image rotation were fixed. See the commit message for commit SHA `cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e` for a detailed explanation. This involved changes to shaders, the addition of a new type of graphic (also reflected in the graphic cache) that allows specifying a border color (which automatically makes the associated texture immutable), and some related fixes. I reproduce the first two paragraphs of the MR description as well:
```
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
```
- Multiflow rivers were enabled.
This does not really need to be part of this MR, and would be easy to revert, but since it seemed to provide a nice improvement it's currently packaged with it.
We already computed multiple outflows from each chunk for erosion purposes long before this MR.
However, we never modified river rendering to be able to handle this case (just a single downhill river flow is complex enough!) so this was not exposed when deciding which chunks were rivers.
Now that
- In the process of making changes related to the world map, various incidental fixes and optimizations were required. Some examples of fixes include making sure terrain is never lowered to below sea level (to make the shadow maps report correct values), fixing map altitudes and colors to understand things like cliffs and "block level" coloring (that doesn'te xist on the column level), and fixing a crashbug when rendering images for the UI where source pixels are strongly rectangular. Some examples of related performance fixes include avoiding allocating a fresh vector for all the maps (i.e. copying it over to change the format from `[u32; n]` to `DynamicImage` and then copying again to convert to `RgbaImage`), and instead using the `gfx::memory::slice` function to accomplish the same thing. These sorts of changes are spread all arond the code.
This includes the additon of a new scene, `voxygen/src/scene/lod.rs`, a new pipeline `voxygen/src/render/pipeline/lod_terrain.rs`, and new shaders `assets/vxygen/shaders/lod-terrain-vert.glsl` and `assets/vxygen/shaders/lod-terrain-frag.glsl`, as well as associated changes to the renderer in `voxygen/src/render/renderer.rs`.
The main idea behind our initial approach to LOD was to take the world data we now get from the server (altitude, color, and horizon mapping).
- Some previously computed values were turned into shader uniforms for better prediction on weak processors. (@zesterer)
- Calls to power or trig functions were removed or replaced with multiplications, where possible.
- After some deliberation
- To properly handle sprite "waving" for nearby sprites,
We explicitly designed the greedy meshing system with figures and sprites in mind.
In both cases, we want to be able to *efficiently* pack many different models into the same texture, especially in cases where we know
we will either not be removing any of the grouped-together from the models from the texture, or will remove all of them at once (so
they can be packed into some specific subtexture).
For sprites, since we know every model in advance and never intend to deallocate them, we currently pack them all as efficiently as
possible into one giant tetxure atlas. However, in the future we might opt to pack them slightly less efficiently in exchange for
shrinking the sprite vertex size.
For figures, we pack all the textures for each *model* into the same atlas.
is a global texture atlas used for every sprite, and for figures which is why we have the ability to mesh multiple
models to the same texture area (using the simple texture atlas allocator) without requiring intermediate vector allocations.
This is accomplished by delaying the time when we actually write the color and light data to the texture until *after* all the
model vertices have been meshed; then, we can just allocate the whole color/light array at once, making the atlas we use an
exact fit. In computer science-y terms, we accomplish this delay by, after we perform the initial greedy meshing (without
texture information), not continuing to create the texture data, but instead constructing a *continuation*--that is, a function
that, when called, will execute the rest of the computation. We push this continuation (which in Rust terms is a `FnOnce` closure
that takes the `ColLightsInfo` that it is supposed to write to as context) onto a
onto a vector
resizing. To allow for suspended writes to texture data, Rust pointed out to me that the continuation that would eventually write the color and light data to the texture atlas (the one that is shared by all models sharing the same greedy mesher) would have to *own* whatever data it mshed. Because we often generate the model data to mesh as a temporary in `voxygen/src/load.rs`, the
- Matrix multiplications in the shader were reduced for figure data (@zesterer).
- Vertex "waves" for fluid data were removed.
- Terrain "bending" near edges was removed.
- Scaling was fixed to make sure empty space was not introduced in a space previously occupied by a block. It was also changed to take ownership of its voxel data,
rather than sharing it, to let it be used with meshing.
- Rust's nightly version was bumped in order to use the `array_map` function, which lets us reuse more code between the simple map and `FigureModelCache`.
- PositionedGlyph::standalone.
---
I tried to cite sources in many cases[^realtime],[^lloyd],[^lispsm],[^pbrt],[^greedy],[^tjunctions]
where I needed features from elsewhere but I am particularly grateful for the following resources,
esepcially where they have accompanying source code. I linked all of them that are accessible to the public (those that are not were
obtained through legal means).
[^realtime]: Eisemann, Elmar, Michael Schwarz, Ulf Assarsson, Michael Wimmer. Real-Time Shadows. A K Peters/CRC Press (T&F), 20160419.
[^lloyd]: Lloyd,B. 2007. [Logarithmic perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). PhD thesis, University of North Carolina.
[^lispsm]: Wimmer, M., Scherzer, D., and Purgathofer, W. 2004. [Light space perspective shadow maps](http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf). In Proceedings of Eurographics Symposium on Rendering 2004, pp. 143– 152.
[^pbrt]: Pharr, Matt, et al. [http://gamma.cs.unc.edu/papers/documents/dissertations/lloyd07.pdf](Physically Based Rendering: From Theory to Implementation). Third edition, Morgan Kaufmann Publishers/Elsevier, 2017.
[^greedy]: mikolalysenko. “Meshing in a Minecraft Game.” 0 FPS, 30 June 2012, <https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/>.
[^tjunctions]: blackflux. “Meshing in Voxel Engines – Part 1.” Blackflux.Com, 23 Feb. 2014, <https://blackflux.wordpress.com/2014/02/23/meshing-in-voxel-engines-part-1/>.
I am also especially grateful to Khronos, Wikiepdia, and stackoverflow for answering many of my specific questions while writing the MR.
---
Squashed commit of the following:
commit 300505e7305a2fdac722a808ee8538323f215f39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 18:46:25 2020 +0200
Fixing cargo doc and typo in CHANGELOG.
commit ec0aeb18e8499d7d84ef818331b4b65c3d76cea6
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 15:38:50 2020 +0200
Hopefully final commit for the LOD branch.
commit 5e8ea0b1eaac02903a02feb2eb038d195de4872f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 10:14:26 2020 +0200
Falling back to power as stopgap.
commit e44a1cbf46504ee9931a01bdc9033e145500d557
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 09:25:41 2020 +0200
Address imbris feedback.
Temporarily disables shiny water, lowers max VD.
These restrictions will be lifted soon after merging.
commit 561e25778a108ac3712f5ec2ce3a51234c4430d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 08:31:13 2020 +0200
Tweaking shaders a bit.
commit 7d19259078ce0dd7b3742ad7d0cb3fab3ece3fdc
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:59:43 2020 +0200
Fix view example as well.
commit 051cd4934e0fad2c0b15db4380a4189fa318679f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 07:29:06 2020 +0200
Fix meshing benchmark.
commit c95e07db3b4dcca285678985e65e31b927cb1c61
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 05:46:22 2020 +0200
Address MR feedback, fix scene clouds.
commit 1bfb816cabdb3ffc1e507a009c2d98696b4b573a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:39:36 2020 +0200
Incorporating Pfau's figure color changes.
New eyes and new humanoid colors.
commit 3f9b89a3ac7b3356b1dba0d1a8f6541357f81469
Merge: e2f5162e4 62c53963a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:29:41 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit e2f5162e4f96f4124aa43488f7245d341b3dcfd4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 20 04:28:38 2020 +0200
World colors are all hotloadable.
They live in assets/world/style/colors.ron.
Only a small handful of hardcoed colors remain in World; they are either
part of the map, or difficult to disentangle from the rest of the
computation. Comments are made where appropriate.
commit 62c53963abe1975009d34a8f9515a355bef24f31
Author: Marcel Märtens <marcel.cochem@googlemail.com>
Date: Wed Aug 19 15:59:00 2020 +0200
replace pretty_env_logger with tracing
commit 5b1625f99d9586fe80e2232f583ec5af9f953099
Merge: d71003acd 4942b5b39
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:15:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit d71003acdabeff970b3928e97c26af6847b5b78e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 19 05:14:34 2020 +0200
Hotloading colors, part 1: colors in common.
Currently, this just entails humanoid colors. There are only three
colors not handled; the light emitter colors in
common/src/comp/inventory/item/tool.rs. These don't seem important
enough to me to warrant making hotloadable, at least not right now, but
if it's needed later we can always add them to the file.
commit 63b5e0e553eb2ea49276f192a6fc7dd65254270d
Merge: c32b337a4 6d2c4b9c1
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 13:05:37 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c32b337a46e10d9de473d178a94a3ccd61c39bb3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:52:04 2020 +0200
Fixing LOD grid, for real.
commit a166ae0360395387e09fb35a1f84210c2ce5ec24
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 17 05:28:05 2020 +0200
Addressing imbris's initial feedback.
Fixes two minor bugs: explosion particles were no longer spawning
randomly, and LOD grids were not perfectly even.
commit 4cbad004f44060994252dd3d38647a14a589712f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:27:58 2020 +0200
Bumping nightly per request.
commit 548680276aac77c25d43d16b5622f847d474dbef
Merge: acc098604 8f8b20c91
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 16 19:26:06 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit acc0986040589a3492f88a740bc3c3fc693b26d3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:28:32 2020 +0200
Lower resolution due to lying drivers.
commit d3b878de2a52c358d2944a6bbd0555dad7fbdb10
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 22:15:38 2020 +0200
Fix issues msh encountered with Intel 4600.
commit 10245e0c1b0cb6fae10d86409435364edc6102ef
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 15 21:15:02 2020 +0200
Merge more models into one mesh than we did previously.
commit 3155c31e663c52ae5c3a53d5fb5665892a1a498a
Merge: 7204cc8a7 3c199280e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:35:22 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7204cc8a7a4f74a30306bd205d9834fee4bb944f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 22:34:43 2020 +0200
Fix not yet done NPC animations.
This forces them all to be the idle animation if not specified.
This fixes issues where you'd have giant NPCs in water.
commit bc83360f2a08918f19d417b5f772e1ff554dba08
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 19:36:37 2020 +0200
Try to fix some bugs:
- Z fighting with LOD terrain and water.
- Audio SFX not playing.
commit 1fd104aa603bf3781b6526a5cada46aeca3049dd
Merge: 862df3c99 7c2c392a3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 12:02:31 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 862df3c9976c4da9bd7cfd784f1a85973127968a
Merge: 0a4218ed9 75c1d4401
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 13 05:52:56 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0a4218ed9d541a2b34c133351bea38a99ddf4ea7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 22:27:14 2020 +0200
Fix particle depth.
commit f51dfdeb442d0dd5243dd2f344fa4be295bd0875
Merge: c6251a956 5e6dc0471
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:19:04 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit c6251a956ad376400dca5c23420cf8d213dc8fdf
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 20:15:46 2020 +0200
Cache figures more intelligently.
Cache figures for longer, and don't cache character states for the
player except where they actually affect the rendered model.
commit 0ed801d5404982c6fb63b1eaa4567d908b294c9d
Merge: c11b9bdf0 eea64f78f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 16:32:24 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit c11b9bdf0a53bf9884d2f5a48fec9b01d582df1a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Aug 12 11:47:15 2020 +0200
Remove unneeded Clippy annotation.
commit 16aa9ef40af56d69289d00aafb3deadfb8bd4f35
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Aug 8 00:53:02 2020 +0200
Fix hotloading and Clippy.
commit 3dc973e0be5b758da1e9805eb764ad401374cd0c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 23:50:27 2020 +0200
Major speedups with SIMD.
commit fba64a7d93d5a96077ce87287bbce6ab9b7fbcae
Merge: 76429d00e d1e10b178
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:19 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 76429d00eea00d212fbd672a84ee91e75b19b938
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 13:23:10 2020 +0200
Add clippy.toml.
commit c79f512f84dbb83cb82b7954db68ff241dfd8e41
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 11:55:20 2020 +0200
Fix all clippy issues, clean up Rust code.
commit 6f90e010b3fbefb53b0d632e819931350015b6b8
Merge: 77a8c7c26 5929cfa5c
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:30 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 77a8c7c267d3f44a1a62bd6b2274359973c5e4d4
Merge: b44e44232 44febaabd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Aug 7 06:47:10 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 5929cfa5c713aa392110bbb62407f76caf53c3df
Author: jshipsey <jshipsey18@gmail.com>
Date: Thu Aug 6 20:47:27 2020 -0400
fixed in-hand arrow bug
commit b44e442325d828f1cd564d66908f89d09e80474b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Aug 6 13:40:35 2020 +0200
Miscellaneous performance improvements.
commit be37acf287c1360d8085862526ac3365ffd1d768
Merge: 125d7fc6c c11876547
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 05:49:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 125d7fc6c4dcd8c8c5f27b8268a4d64f409f3644
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Aug 3 04:55:31 2020 +0200
Abstract over simd vs. repr_c vectors.
Also some minor improvements to Event size.
commit d4d4956e9252e1241ce110b2aa85076c6b1e2a23
Merge: 5f3b7294a aced5f979
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:56:54 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 5f3b7294af1f8533edc2620b58863c248e2b07af
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:43:52 2020 +0200
Fix formatting issues I missed before.
commit a428a3ebba70dcab63dd0f8cd983120c90617271
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Aug 2 20:41:51 2020 +0200
Fix clippy warnings, part 1.
There aer still a bunch of type too complex and
function takes too many arguments warnings that I'll fix later
(or ignore, since in the one case I did fix a function takes too
many arguments warning I think it made the code *less* readable).
commit ba54307540ed8a937ac08209730284fc653af85b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 30 13:22:42 2020 +0200
Fix light animations so they are removed when the light turns off.
commit 7e0f4bcbf0f4717145d8beac40d52e3acebbe2aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 21:10:20 2020 +0200
Fix crash in edge case for pixel art.
commit 56da06f7a351e2b949e9b014a90b974d511a0924
Merge: cf74d55f2 9f53a4a19
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:56:52 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit cf74d55f2e3d2ae7d25fd68d5c73b01a6afde86e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 29 18:29:52 2020 +0200
Fix map image artifacts and remove unneeded allocations.
Specifically, we address three concerns (the image stretching during
rotation, artifacts around the image due to clamping to the nearest
border color when the image is drawn to a larger space than the image
itself takes up, and potential artifacts around a rotated image which
accidentally ended up in an atlas and didn't have enough extra space to
guarantee the rotation would work).
The first concern was addressed by fixing the dimensions of the map
images drawn from the UI (so that we always use a square source
rectangle, rather than a rectangular one according to the dimensions of
the map). We also fixed the way rotation was done in the fragment
shader for north-facing sources to make it properly handle aspect ratio
(this was already done for north-facing targets). Together, these fix
rendering issues peculiar to rectangular maps.
The second and third concerns were jointly addressed by adding an
optional border color to every 2D image drawn by the UI. This turns
out not to waste extra space even though we hold a full f32 color
(to avoid an extra dependency on gfx's PackedColor), since voxel
images already take up more space than Optiion<[f32; 4]> requires.
This is then implemented automatically using the "border color"
wrapping method in the attached sampler.
Since this is implemented in graphics hardware, it only works (at
least naively) if the actual image bounds match the texture bounds.
Therefore, we altered the way the graphics cache stores images
with a border color to guarantee that they are always in their own
texture, whose size exactly matches their extent. Since the easiest
currently exposed way to set a border color is to do so for an
immutable texture, we went a bit further and added a new "immutable"
texture storage type used for these cases; currently, it is always
and automatically used only when there is a specified border color,
but in theory there's no reason we couldn't provide immutable-only
images that use the default wrapping mdoe (though clamp to border
is admittedly not a great default).
To fix the maps case specifically, we set the border color to a
translucent version of the ocean border color. This may need
tweaking going forward, which shouldn't be hard.
As part of this process, we had to modify graphics replacement to
make sure immutable images are *removed* when invalidated, rather
than just having a validity flag unset (this is normally done by
the UI to try to reuse allocations in place if images are updated
in benign ways, since the texture atlases used for Ui do not
support deallocation; currently this is only used for item images,
so there should be no overlap with immutable image replacement,
so this was purely precautionary).
Since we were already touching the relevant code, we also updated
the image dependency to a newer version that provides more ways
to avoid allocations, and made a few other changes that should
hopefully eliminate redundant most of the intermediate buffer
allocations we were performing for what should be zero-cost
conversions. This may slightly improve performance in some
cases.
commit ad18ce939940a8c697270f6e9b94db9942fd8295
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 13:21:09 2020 +0200
Fix continent scale hack.
commit 36b1cb074f5b195aebd7dbbc3da7f0246a1a18ec
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 12:11:40 2020 +0200
Enable loading different sized maps without a recompile.
We may want to tweak the effects of the continent_scale_hack.
commit 13b6d4d534cc4814b7cb3294ca41bbfea0a6b186
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 28 10:55:48 2020 +0200
Removing WORLD_SIZE, part 1.
Erased almost every instance of WORLD_SIZE and replaced it with a local
power of two, map_size_lg (which respects certain invariants; see
common/src/terrain/map.rs for more details about MapSizeLg). This also
means we can avoid a dependency on the world crate from client, as
desired.
Now that the rest of the code is not expecting a fixed WORLD_SIZE, the
next step is to arrange for maps to store their world size, and to use
that world size as a basis prior to loading the map (as well, probably,
as prior to configuring some of the noise functions).
commit 30b1d2c6428230a9eaa0d749cdcbbd6f1cbccd78
Merge: 7d56ba31b 1377b369f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:58 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 7d56ba31b445441461b28a07fc495d7d4f047c17
Merge: 2101113b4 598f14b25
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Jul 27 13:16:27 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 1377b369f6db2258e910d467a5740f31789e3ded
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sun Jul 19 23:25:38 2020 +0200
more saturated pumpkins
commit ae8d50527f93bb0616c2ad46ce4dacb63bc37c6d
Author: Monty Marz <m.marzouq@gmx.de>
Date: Sat Jul 18 20:29:56 2020 +0200
acacia models
commit 2101113b467e691de787392d7f20f1745f5637bd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 18 18:55:25 2020 +0200
Higher detail LOD.
commit add2cfae04b4385fa5590e11e2bd5229d9dee0aa
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 16 01:57:39 2020 +0200
Revert some irrelevant stuff.
commit 2e2ab3dc1eaa59a4aef7f8d34a53d8aae4c8553a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 15 13:30:49 2020 +0200
Fixing various things about shadows.
* Correcting optimal LISPSM parameter.
* Figure shadows are cast when they're not visible.
* Chunk shadows stay cast until you look away.
* Seamless cubemaps for point lights.
* Etc.
commit 6c31e6b56217274285b597af297036691ea5d897
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 19:50:26 2020 +0200
Fix shadow creation.
commit 6332cbe006115ae205597529cd8bbccd146c2cca
Merge: be438657c 930e0028b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:47:00 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit be438657c33d7b5bfb0a9582c3ed3fd366637323
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Jul 12 18:28:08 2020 +0200
Tweaks to shadows.
Added shadow map resolution configuration, added seamless cubemaps,
documented all existing rendering options, and fixed a few Clippy
errors.
commit 23b4058906013c7d2a40c286e20e32c5fbd897ed
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 10:11:19 2020 +0200
Fix moon, use nonlinear noise for terrain.
Note that the latter has a bit of performance cost.
commit 7fbe5cbfbb9dc29607957b8e62f432a4deed193d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:23:02 2020 +0200
Address lies about max texture size.
commit bcfc62b5e13a1cdd83f57535fde4694720bebfd9
Merge: 75e3626a7 18a08e8fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:22:08 2020 +0200
Merge remote-tracking branch 'origin/sharp/small-fixes' into sharp/small-fixes
commit 75e3626a785919f43fdcf2127c2b10e3e4df2f9f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Jul 8 02:21:52 2020 +0200
OpenGL 3.3 minimum.
commit 18a08e8fe2739f02af99a5d2cb4e7c38c49e858b
Author: Monty Marz <m.marzouq@gmx.de>
Date: Tue Jul 7 23:57:52 2020 +0200
settings localization
commit 90c5d1ca3620092bc3ae10b2211489eb1cf6f5e8
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 21:11:48 2020 +0200
Lower near distance.
commit 0e66f02b25aaddaa2dfddbbc89cd67de54a9a7b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 20:09:01 2020 +0200
All sprites sway in the wind now.
commit db1401a6910bf42dcf502462c90038752ff5fbdb
Merge: 69e508d8c e8b4b29d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 19:34:17 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 69e508d8c94d8973033817ca86f357e466fc7c4d
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Jul 7 18:41:37 2020 +0200
Make it easy to switch to SIMD for math.
commit ffe0f5928c7a7e87d00cb5426b3b1d831d7e02fd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 21:21:12 2020 +0200
Fix some issues with underwater rendering.
commit bfda6da42f38fd02c31ee92c81ab785a3e50c2a0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 19:17:59 2020 +0200
Fix some minor display issues.
commit 0ed752e087968cf901301884aaeae698e32ef8a5
Merge: ccc6a06a8 518edcb85
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:14:21 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit ccc6a06a8d4504d6b9f7af7905a414d2ee06ab76
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 18:04:34 2020 +0200
Some minor changes.
commit 4e020246702889269efe1a191788992164c508d6
Merge: 50a64d927 e05c9267a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 16:17:40 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 50a64d927e6c4f4b0e4688e4cbfca694bc3f922a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Jul 4 13:07:03 2020 +0200
Fix far plane.
commit 7dd06da34cae8f9ea3b6c889fe965181f3fd3949
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:25:35 2020 +0200
Add shadows.glsl.
commit 618a18c998778bf871b905a74657440fcc384c80
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Jul 2 22:10:22 2020 +0200
Adding shadows, greedy meshing, and more.
commit eaea83fe6a5cb1cb0ba8beef888183c718258496
Merge: 267018495 2f89b863e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 22:47:07 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 2670184954a13e4a9e7a4e35ba79aac0c5fac2f7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 21:20:01 2020 +0200
Make civsim and sites deterministic.
For anything in worldgen where you use a HashMap, *please* think
carefully about which hasher you are going to use! This is
especially true if (for some reason) you are depending on hashmap
iteration order remaining stable for some aspect of worldgen.
commit f8376fd5dc72b4a9c2f51a6b4570d59c8b8e9343
Merge: 654f7e049 cdee191dd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu May 21 17:53:57 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 654f7e049258d9da27c09608bbe6a46ffa8787e5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed May 20 21:22:30 2020 +0200
Correct backface culling.
commit 560501df05ca725409b0f2e4eb31bdfdc15fd0c7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue May 19 17:22:06 2020 +0200
Greedy messhing for shadows.
commit a4d87e1875ca543436e6bbbeb20348facc5a52d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun May 17 05:59:00 2020 +0200
Shadow maps work for lantern.
commit 243d0837b8a3b08172c9a3c348d964d7ddc2a0a8
Merge: 04382dc28 71dd520cd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:53:13 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 04382dc28632b6c66e8821f6870c0daaa1c1901a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 15 14:22:17 2020 +0200
WIP: better graphics config, better LOD, shadow maps.
commit 22ddbad3eb32bfa70f0932176022208fe67ded81
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 18:54:09 2020 +0200
Minor shader fixes.
commit 746a10e8d01ac235f994b0cde78fa48998602a1f
Merge: 0f4a0e763 40ab94673
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat May 2 04:02:09 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 0f4a0e763db3afbdc4fb0558611f38326ca87151
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 23:03:24 2020 +0200
Switch back to pop-in terrain.
commit dd74fa7e4a53667b38811d7aec58d7f6a68889bb
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri May 1 22:58:55 2020 +0200
LOD shading closer to voxel shading.
commit ef67bd58ba0bdaf622b078892d768263b6cba268
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 28 20:49:03 2020 +0200
Experimental underwater lighting.
commit 2c5ad9d07605e80d5fd5679dd3a5d70c605b86a9
Merge: 748279835 303967a6f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 22:35:24 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 7482798354eda18c8207950080fc24d443a369de
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 21:59:55 2020 +0200
Replace discard in figure-frag.
commit d83b4ae69be4912f69bf7835f509c68a1c7770a4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:45:57 2020 +0200
Fix sprite lighting, HDR from focus_pos.
commit 0594238004f116274905fa0ed7c2b6c417ed1d29
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 18:14:10 2020 +0200
Proper HDR from point lights.
commit 48c93d2b41ce5743103d18e76cc228f5ac766492
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 14:01:43 2020 +0200
Brighter ambiance, darker LOD shadows.
commit e0452e895ccfa8a43f368cae3b8b8aedc24dad93
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 13:13:23 2020 +0200
More proper HDR.
commit 4c6da3ed16cfeebb455e40da5f557b4af9a499d7
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 27 00:13:10 2020 +0200
Trying LOD noise.
commit 682a3d74c85df5503ffe1fc1cc891bce789df1ad
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 23:11:08 2020 +0200
Fix LOD heights in towns.
commit cc39e5734e8b18f9077bf42e66337c1319dd6b6e
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sun Apr 26 21:01:23 2020 +0200
More LOD fixes.
commit 8116b21c2e51c836e77894e309ac273caf2917b3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:54:43 2020 +0200
I like this coloring.
commit bc2560ea90b36f4b46190005344232d993043ac3
Merge: 14effdd5d e690efe71
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 23:48:33 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit 14effdd5db8747fcf3eb34f03b46b7792e92d1c5
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:24:35 2020 +0200
Re-saturate.
commit 48a643955d4435b78179acba0beb4a979905cc31
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 22:23:57 2020 +0200
Various fixes.
commit f7b497a0c25f4ad4682c71dd1ed6f608052feb9b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 03:22:49 2020 +0200
Render figures again.
commit 44e4aad48deba8266b9f8bdfd3db096b381f5327
Merge: e6f0a5a98 9ec319a18
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 25 02:01:04 2020 +0200
Merge remote-tracking branch 'origin/master' into sharp/small-fixes
commit e6f0a5a981a82533ba188fff0a54ce98577bb152
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 24 16:12:20 2020 +0200
Add atmospheric scattering.
commit f2953087f691a8edbc001cb98ebf5059fc6f8ac0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 23 00:01:20 2020 +0200
Fix shadowing for specular reflections.
commit ddd4a67a9799b8d08c7dc0c2bec90621c2bed0e3
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Wed Apr 22 22:56:12 2020 +0200
HDR fixes.
commit 1015e60deef3c447381996277df7496707a63bd0
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Tue Apr 21 18:25:19 2020 +0200
More lighting changes.
commit 80c264abd111fb237e57843efcb5c071d4f84613
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Mon Apr 13 00:29:59 2020 +0200
Lighting experiments.
commit 8414987e589dd5102bad89762a3adaccc0bfe957
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 9 02:38:40 2020 +0200
WIP -- lighting changes and soft shadows.
commit 9cd2b3fb0d6b49776c6dfe463e4169637250b11a
Merge: c7ea687eb 8b149ad11
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:29 2020 +0200
Merge branch 'sharp/new-lighting' into sharp/small-fixes
commit c7ea687ebbc5aace1b455f134a5bf49ce2c7434a
Merge: 476441531 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:33:02 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/small-fixes
commit 8b149ad11ad4bb75018fcf9519baec27d1c95951
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Sat Apr 4 02:32:39 2020 +0200
Trying out a new lighting model.
commit b0ac9f36f755dd06f7c17c46150568064790864f
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 07:56:11 2020 +0200
Use bicubic interpolation for terrain.
commit f6fc9307a121514b614bc50ef8eb055953e7da8a
Merge: 33140a295 22f3319b4
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 05:01:41 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 4764415312aae6e9ac2d00e86e84577cb958f1ab
Merge: ed2d0111d 13388ee6a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Apr 3 04:54:48 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 13388ee6a42943f3f79a9cb488346cef18e272fe
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 20:30:08 2020 +0200
Various fixes (to coloring and to soft shadows).
commit fbd084a94a067082a87cd6d28b82054709bc9265
Merge: 5a089863b 4fdf6896a
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 18:50:38 2020 +0200
Merge branch 'master' of gitlab.com:veloren/veloren into sharp/map-colors
commit ed2d0111d994262ae836d84d1fe5a45e4de72a0b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 06:49:27 2020 +0200
Combining colors and LOD.
commit 88342640c6b835114d01c797b89fdede3b0a2108
Merge: 33140a295 5a089863b
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:49:20 2020 +0200
Merge branch 'sharp/map-colors' into sharp/small-fixes
commit 33140a2951b8212725f42c758b277aaec4d888f7
Merge: 4c65a5aed f34d4b379
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 04:36:21 2020 +0200
Merge remote-tracking branch 'origin/master' into zesterer/lod
commit 5a089863beb01d4794bbe3580ada47b278715ea2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 03:17:49 2020 +0200
Making maps brighter.
This is probably not the right way to do it, but oh well!
commit 32b2c99109dd486aa922886081068f9c550c83f2
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Thu Apr 2 02:46:36 2020 +0200
Horizon mapping and "layered" map generation.
Horizon mapping is a method of shadow mapping specific to height maps.
It can handle any angle between 0 and 90 degrees from the ground, as
long as know the horizontal direction in advance, by remembering only a
single angle (the "horizon angle" of the shadow map). More is explained
in common/src/msg/server.rs. We also remember the approximate height of
the largest occluder, to try to be able to generate soft shadows and
create a vertical position where the shadows can't go higher.
Additionally, map generation has been reworked. Instead of computing
everything from explicit samples, we pass in sampling functions that
return exactly what the map generator needs. This allows us to cleanly
separate the way we sample things like altitudes and colors from the map
generation process. We exploit this to generate maps *partially* on the
server (with colors and rivers, but not shading). We can then send the
partially completed map to the client, which can combine it with shadow
information to generate the final map. This is useful for two reasons:
first, it makes sure the client can apply shadow information by itself,
and second, it lets us pass the unshaded map for use with level of
detail functionality.
For similar reasons, river generation is split
out into its own layer, but for now we opt to still generate rivers on
the server (since the river wire format is more complicated to compress
and may require some extra work to make sure we have enough precision to
draw rivers well enough for LoD).
Finally, the mostly ad-hoc lighting we were performing has been (mostly)
replaced with explicit Phong reflection shading (including specular
highlights). Regularizing this seems useful and helps clarify the
"meaning" of the various light intensities, and helps us keep a more
physically plausible basis. However, its interaction with soft shadows
is still imperfect, and it's not yet clear to me what we need to do to
turn this into something useful for LoD.
commit f8926a5737ddc51f3d585c651a64c43677aae0f4
Merge: a1aee931e 875ae6ced
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Mar 13 13:32:42 2020 +0100
Merge remote-tracking branch 'origin/master' into sharp/map-colors
commit 4c65a5aed353b119aea65a2aaeb94549b67beb42
Author: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Mon Feb 24 16:48:05 2020 +0000
Made LOD setting slider exponential
commit 2fa7b2d20d7233dc8bfd64f9f7f54617575248f1
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 17:49:53 2020 +0000
Added mist to LoD
commit aab059a450b5f635777129ff82cc15b662965c3c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 15:14:06 2020 +0000
Added LoD slider
commit 779c36b538121c5ade3633ae5cb67bb14c8c3877
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:54:55 2020 +0000
Reduced cost of vertex pushing
commit 9fea150473906b166365b738ebcea07c697daf3d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 12:38:53 2020 +0000
Fixed maths, improved LoD resolution
commit 5481df38fea5bf183ff376a3337179cfaa5233dc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Feb 24 11:22:50 2020 +0000
Dynamically relocate LoD vertices to enhance details
commit a3e36a50ababd615da7db1b26158c7906a5def01
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 18:13:51 2020 +0000
Simpler terrain spiral rendering
commit 255f450ae9ac8763db4bede075fb409161ed57cc
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:53:17 2020 +0000
Better LoD precision
commit 3d027aebe812a5b8658a4eb8123dc9f61b3776d2
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 16:04:03 2020 +0000
Better falloff
commit be775c9484b457b2c0b1a494aec03392d0c70e76
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Feb 23 15:30:45 2020 +0000
Applied good ideas from experimental branch
commit 58587b68545a23c5c04ab4574a4b94b3bc982246
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 16:15:13 2020 +0000
Minor fixes to LoD merging
commit 7b42aebd709c14df2db766aad61d9280ad24d84d
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 15:04:44 2020 +0000
Capped LoD dragging
commit 8aafc559f87124e1ea5ca6e3ddc2aa0c242d793c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:54:37 2020 +0000
Better blending between LoD and terrain border
commit edd3455d5161792d87ddc8eadc0ecbad5532b284
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:40:19 2020 +0000
Fixed LoD z depth, added sea level offset
commit b9b06744620114dd5556e73f64fa93c145503a7c
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 14:27:43 2020 +0000
Better LoD smoothing
commit a1aee931e790431560cd2d953ad61d9497072afd
Author: Joshua Yanovski <pythonesque@gmail.com>
Date: Fri Feb 21 14:52:17 2020 +0100
Adding shadows.
commit 2400786c13dd891c131ed86d48d05df516a8a778
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Feb 21 13:48:40 2020 +0000
Use world map as LoD source
commit dbf650f504a4c25fbbc2096ac3616c736bf52d23
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Mon Jan 20 00:48:14 2020 +0000
Better clouds at distance
commit 5e6f81b86cdb9730b9b056877b19257075fd5fa8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Sun Jan 19 23:59:02 2020 +0000
sync
commit 745e7540ddb000cc645f612767b337c2ddc3f7c0
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 12:40:48 2019 +0000
Improved cloud falloff mist, faster noise sampling
commit f6a200d0cb866196ba57697466755f9e0c7ea5d8
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Fri Nov 22 10:09:00 2019 +0000
Improved long-range depth precision, removed unnecessary LoD polygons
commit 63d1b2bb2292898d59fb4f4e502201103dfeb86f
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 20:57:46 2019 +0000
Working LoD shader
commit f13d98ee3e58f881e8b978861a67663b59ed91ec
Author: Joshua Barretto <joshua.s.barretto@gmail.com>
Date: Thu Nov 21 11:03:40 2019 +0000
LoD first attempt (stack overflow issue)
2020-08-20 18:34:59 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
result
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Create a new shadow map pipeline.
|
|
|
|
fn create_shadow_pipeline<P: gfx::pso::PipelineInit>(
|
|
|
|
factory: &mut gfx_backend::Factory,
|
|
|
|
pipe: P,
|
|
|
|
vs: &str,
|
|
|
|
gs: Option<&str>,
|
|
|
|
fs: &str,
|
|
|
|
ctx: &IncludeContext,
|
|
|
|
cull_face: gfx::state::CullFace,
|
|
|
|
offset: Option<gfx::state::Offset>,
|
|
|
|
) -> Result<GfxPipeline<P>, RenderError> {
|
|
|
|
let vs = ctx.expand(vs)?;
|
|
|
|
let gs = gs.map(|gs| ctx.expand(gs)).transpose()?;
|
|
|
|
let fs = ctx.expand(fs)?;
|
|
|
|
|
|
|
|
let shader_set = if let Some(gs) = gs {
|
|
|
|
factory.create_shader_set_geometry(vs.as_bytes(), gs.as_bytes(), fs.as_bytes())?
|
|
|
|
} else {
|
|
|
|
factory.create_shader_set(vs.as_bytes(), fs.as_bytes())?
|
|
|
|
};
|
|
|
|
|
|
|
|
Ok(GfxPipeline {
|
|
|
|
pso: factory.create_pipeline_state(
|
|
|
|
&shader_set,
|
|
|
|
gfx::Primitive::TriangleList,
|
|
|
|
gfx::state::Rasterizer {
|
|
|
|
front_face: gfx::state::FrontFace::CounterClockwise,
|
|
|
|
// Second-depth shadow mapping: should help reduce z-fighting provided all objects
|
|
|
|
// are "watertight" (every triangle edge is shared with at most one other
|
|
|
|
// triangle); this *should* be true for Veloren.
|
|
|
|
cull_face: match cull_face {
|
|
|
|
gfx::state::CullFace::Front => gfx::state::CullFace::Back,
|
|
|
|
gfx::state::CullFace::Back => gfx::state::CullFace::Front,
|
|
|
|
gfx::state::CullFace::Nothing => gfx::state::CullFace::Nothing,
|
|
|
|
},
|
|
|
|
method: gfx::state::RasterMethod::Fill,
|
|
|
|
offset,
|
|
|
|
samples: None,
|
|
|
|
},
|
|
|
|
pipe,
|
|
|
|
)?,
|
2019-01-11 23:18:34 +00:00
|
|
|
})
|
|
|
|
}
|